SensioLabs\DeprecationDetector\DetectorFactory::create PHP Метод

create() публичный Метод

public create ( Configuration $configuration, Symfony\Component\Console\Output\OutputInterface $output ) : DeprecationDetector
$configuration SensioLabs\DeprecationDetector\Configuration\Configuration
$output Symfony\Component\Console\Output\OutputInterface
Результат 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, new UsageFinderFactory());
        $this->ancestorResolver = new AncestorResolver($deprecationUsageParser);
        $ruleSetProgressOutput = new VerboseProgressOutput(new ProgressBar($output), $configuration->isVerbose(), 'RuleSet generation');
        $ruleSetDeprecationParser = $this->getDeprecationParser();
        $ruleSetDeprecationFinder = new ParsedPhpFileFinder($ruleSetDeprecationParser, $ruleSetProgressOutput, new DeprecationFinderFactory());
        $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($this->getPredefinedRuleSet(), $ruleSetLoader, $this->ancestorResolver, $deprecationUsageFinder, $violationDetector, $renderer, $progressOutput);
    }

Usage Example

 public function testCreateDetector()
 {
     $configuration = $this->prophesize('SensioLabs\\DeprecationDetector\\Configuration\\Configuration');
     $output = $this->prophesize('Symfony\\Component\\Console\\Output\\OutputInterface');
     $factory = new DetectorFactory();
     $this->assertInstanceOf('SensioLabs\\DeprecationDetector\\DeprecationDetector', $factory->create($configuration->reveal(), $output->reveal()));
 }
All Usage Examples Of SensioLabs\DeprecationDetector\DetectorFactory::create