Inheritance: implements Go\Instrument\Transformer\SourceTransformer
Exemplo n.º 1
0
 /**
  * Constructs a weaving transformer
  *
  * @param AspectKernel $kernel Instance of aspect kernel
  * @param Broker $broker Instance of reflection broker to use
  * @param AdviceMatcher $matcher Advice matcher for class
  * @param AspectLoader $loader Loader for aspects
  */
 public function __construct(AspectKernel $kernel, Broker $broker, AdviceMatcher $matcher, AspectLoader $loader)
 {
     parent::__construct($kernel);
     $this->broker = $broker;
     $this->adviceMatcher = $matcher;
     $this->aspectLoader = $loader;
 }
Exemplo n.º 2
0
 /**
  * Class constructor
  *
  * @param AspectKernel $kernel Instance of aspect kernel
  * @param array|callable $transformers Source transformers or callable that should return transformers
  * @param CachePathManager $cacheManager Cache manager
  */
 public function __construct(AspectKernel $kernel, $transformers, CachePathManager $cacheManager)
 {
     parent::__construct($kernel);
     $this->cacheManager = $cacheManager;
     $this->cacheFileMode = (int) $this->options['cacheFileMode'];
     $this->transformers = $transformers;
 }
Exemplo n.º 3
0
 /**
  * Constructs a weaving transformer
  *
  * @param AspectKernel $kernel Instance of aspect kernel
  * @param AdviceMatcher $adviceMatcher Advice matcher for class
  * @param CachePathManager $cachePathManager Cache manager
  * @param AspectLoader $loader Loader for aspects
  */
 public function __construct(AspectKernel $kernel, AdviceMatcher $adviceMatcher, CachePathManager $cachePathManager, AspectLoader $loader)
 {
     parent::__construct($kernel);
     $this->adviceMatcher = $adviceMatcher;
     $this->cachePathManager = $cachePathManager;
     $this->aspectLoader = $loader;
 }
Exemplo n.º 4
0
 /**
  * Constructs a weaving transformer
  *
  * @param AspectKernel $kernel Instance of aspect kernel
  * @param Broker $broker Instance of reflection broker to use
  * @param AdviceMatcher $adviceMatcher Advice matcher for class
  */
 public function __construct(AspectKernel $kernel, Broker $broker, AdviceMatcher $adviceMatcher)
 {
     parent::__construct($kernel);
     $this->broker = $broker;
     $this->adviceMatcher = $adviceMatcher;
     $this->includePaths = $this->options['includePaths'];
     $this->excludePaths = $this->options['excludePaths'];
 }
Exemplo n.º 5
0
 /**
  * Class constructor
  *
  * @param AspectKernel $kernel Instance of aspect kernel
  * @param array|callable $transformers Source transformers or callable that should return transformers
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(AspectKernel $kernel, $transformers)
 {
     parent::__construct($kernel);
     $cacheDir = $this->options['cacheDir'];
     if ($cacheDir) {
         if (!is_dir($cacheDir)) {
             $cacheRootDir = dirname($cacheDir);
             if (!is_writable($cacheRootDir) || !is_dir($cacheRootDir)) {
                 throw new \InvalidArgumentException("Can not create a directory {$cacheDir} for the cache.\n                        Parent directory {$cacheRootDir} is not writable or not exist.");
             }
             mkdir($cacheDir, 0770);
         }
         if (!$this->kernel->hasFeature(Features::PREBUILT_CACHE) && !is_writable($cacheDir)) {
             throw new \InvalidArgumentException("Cache directory {$cacheDir} is not writable");
         }
         $this->cachePath = $cacheDir;
     }
     $this->rootPath = $this->options['appDir'];
     $this->transformers = $transformers;
 }
Exemplo n.º 6
0
 /**
  * Class constructor
  *
  * @param AspectKernel $kernel Instance of kernel
  */
 public function __construct(AspectKernel $kernel)
 {
     parent::__construct($kernel);
     self::$rootPath = $this->options['appDir'];
     self::$rewriteToPath = $this->options['cacheDir'];
 }