/** * Static configurator for filter * * @param array $options Kernel options * @param string $filterName Name of the filter to inject * * @throws \RuntimeException if filter was configured early */ protected static function configure(array $options, $filterName) { if (self::$options) { throw new \RuntimeException("Filter injector can be configured only once."); } self::$options = $options; self::$filterName = $filterName; }
/** * Static configurator for filter * * @param AspectKernel $kernel Kernel to use for configuration * @param string $filterName Name of the filter to inject * @param CachePathManager $cacheManager Cache manager */ protected static function configure(AspectKernel $kernel, $filterName, CachePathManager $cacheManager) { if (self::$kernel) { throw new \RuntimeException("Filter injector can be configured only once."); } self::$kernel = $kernel; self::$options = $kernel->getOptions(); self::$filterName = $filterName; self::$cachePathManager = $cacheManager; }