/**
  * {@inheritDoc}
  */
 public function getConfigTreeBuilder()
 {
     $home = FileUtil::getUserHomeDirOrSysTempDir();
     $workarounds = new Workarounds();
     $defaultCacheDriver = $workarounds->hasSerializeReferenceIssue() ? 'memory' : 'file';
     $treeBuilder = new TreeBuilder();
     $rootNode = $treeBuilder->root('pdepend');
     $rootNode->children()->arrayNode('cache')->addDefaultsIfNotSet()->children()->enumNode('driver')->defaultValue($defaultCacheDriver)->values(array('file', 'memory'))->end()->scalarNode('location')->defaultValue($home . '/.pdepend')->end()->end()->end()->arrayNode('image_convert')->addDefaultsIfNotSet()->children()->scalarNode('font_size')->defaultValue('11')->end()->scalarNode('font_family')->defaultValue('Arial')->end()->end()->end()->arrayNode('parser')->addDefaultsIfNotSet()->children()->integerNode('nesting')->defaultValue(8192)->end()->end()->end()->end();
     $extensionsNode = $rootNode->children()->arrayNode('extensions')->addDefaultsIfNotSet()->children();
     foreach ($this->extensions as $extension) {
         $extensionNode = $extensionsNode->arrayNode($extension->getName());
         $extension->getConfig($extensionNode);
     }
     return $treeBuilder;
 }
Exemple #2
0
    /**
     * If the current PHP installation requires some workarounds or limitations,
     * this method will output a message on STDOUT.
     *
     * @return void
     */
    protected function printWorkarounds()
    {
        $workarounds = new Workarounds();

        if ($workarounds->isNotRequired()) {
            return;
        }

        echo 'Your PHP version requires some workaround:', PHP_EOL;
        foreach ($workarounds->getRequiredWorkarounds() as $workaround) {
            echo '- ', $workaround, PHP_EOL;
        }
        echo PHP_EOL;
    }