示例#1
0
 /**
  * Initialize bindings after the application is initialized and config is loaded
  *
  * @param array $configuration
  */
 public function postBind(array $configuration)
 {
     $this->container->instance('config', $configuration);
     // Setup AnalysisException ComplexityComputing
     AnalysisException::setComplexityComputer($this->container['complexity-computer']);
     $this->container->bind('message-provider', function ($container) {
         return new MessageProvider($container['config']);
     });
     $this->container->bind('flaw-detector', function ($container) {
         return new FlawDetector($container['bootstrapper'], $container['config']);
     });
     $this->container->bind('analyzer', function ($container) {
         return $this->bootstrap(new Analyzer($container['parser'], $container['flaw-detector']));
     });
     $this->container->bind(FeedbackInterface::class, function ($container) {
         return new ConsolePlainFeedback($container['config'], $container['output']);
     });
     $this->container->bind('report-generator', function ($container) {
         return new ReportGenerator($container['filesystem']);
     });
     $this->container->bind('report-service', function ($container) {
         return new ReportService($container['report-generator']);
     });
     $this->container->bind('analyzer-service', function ($container) {
         return new AnalyzerService($container['analyzer'], $container['code-scanner'], $container[FeedbackInterface::class], $container['report-service']);
     });
     $this->container->bind(InspectCommand::class, function ($container) {
         return new InspectCommand($container['analyzer-service']);
     });
 }