public function testRuleSet() { $configuration = new Configuration('path/to/rule_set', 'path/to/container.xml', true, 'path/to/cache/dir/', '', true, true, 'html.log'); $this->assertEquals('path/to/rule_set', $configuration->ruleSet()); $this->assertEquals('path/to/container.xml', $configuration->containerPath()); $this->assertTrue($configuration->useCachedRuleSet()); $this->assertEquals('path/to/cache/dir/', $configuration->ruleSetCacheDir()); $this->assertEquals('', $configuration->filteredMethodCalls()); $this->assertTrue($configuration->failOnDeprecation()); $this->assertTrue($configuration->isVerbose()); $this->assertEquals('html.log', $configuration->logHtml()); }
/** * @param Configuration $configuration * @param OutputInterface $output * * @return DeprecationDetector */ public function create(Configuration $configuration, OutputInterface $output) { $this->symbolTable = new SymbolTable(); $deprecationProgressOutput = new VerboseProgressOutput(new ProgressBar($output), $configuration->isVerbose(), 'Deprecation detection'); $deprecationUsageParser = $this->getUsageParser($configuration); $deprecationUsageFinder = new ParsedPhpFileFinder($deprecationUsageParser, $deprecationProgressOutput); $deprecationUsageFinder->exclude('vendor')->exclude('Tests')->exclude('Test'); $this->ancestorResolver = new AncestorResolver($deprecationUsageParser); $ruleSetProgressOutput = new VerboseProgressOutput(new ProgressBar($output), $configuration->isVerbose(), 'RuleSet generation'); $ruleSetDeprecationParser = $this->getDeprecationParser(); $ruleSetDeprecationFinder = new ParsedPhpFileFinder($ruleSetDeprecationParser, $ruleSetProgressOutput); $ruleSetDeprecationFinder->contains('@deprecated')->exclude('vendor')->exclude('Tests')->exclude('Test'); $deprecationDirectoryTraverser = new DirectoryTraverser($ruleSetDeprecationFinder); $violationDetector = $this->getViolationDetector($configuration); $renderer = $this->getRenderer($configuration, $output); $ruleSetLoader = $this->getRuleSetLoader($deprecationDirectoryTraverser, $configuration); $progressOutput = new DefaultProgressOutput($output, new Stopwatch()); return new DeprecationDetector($ruleSetLoader, $this->ancestorResolver, $deprecationUsageFinder, $violationDetector, $renderer, $progressOutput); }