コード例 #1
0
 /**
  * Get intercepted instances from defined class list
  *
  * @param array $definedClasses
  * @return array
  */
 private function getInterceptedClasses($definedClasses)
 {
     $intercepted = [];
     foreach ($definedClasses as $definedClass) {
         if ($this->interceptionConfig->hasPlugins($definedClass) && $this->typeReader->isConcrete($definedClass)) {
             $intercepted[] = $definedClass;
         }
     }
     return $intercepted;
 }
コード例 #2
0
 /**
  * Flushes interception cached configuration and generates a new one
  *
  * @return void
  */
 public function doOperation()
 {
     if (empty($this->data)) {
         return;
     }
     $definitions = [];
     foreach ($this->data as $path) {
         $definitions = array_merge($definitions, $this->interceptionsInstancesNamesList->getList($path));
     }
     $this->configInterface->initialize($definitions);
 }
コード例 #3
0
 /**
  * Flushes interception cached configuration and generates a new one
  *
  * @return void
  */
 public function doOperation()
 {
     if (empty($this->data)) {
         return;
     }
     $logWriter = new \Magento\Tools\Di\Compiler\Log\Writer\Quiet();
     $errorWriter = new \Magento\Tools\Di\Compiler\Log\Writer\Console();
     $log = new \Magento\Tools\Di\Compiler\Log\Log($logWriter, $errorWriter);
     $validator = new \Magento\Framework\Code\Validator();
     $validator->add(new \Magento\Framework\Code\Validator\ConstructorIntegrity());
     $validator->add(new \Magento\Framework\Code\Validator\ContextAggregation());
     $directoryCompiler = new \Magento\Tools\Di\Compiler\Directory($log, $validator);
     foreach ($this->data as $path) {
         if (is_readable($path)) {
             $directoryCompiler->compile($path);
         }
     }
     list($definitions, ) = $directoryCompiler->getResult();
     $this->configInterface->initialize(array_keys($definitions));
 }