pathFinder = $pathFinder; } public function getBundles() { $bundles = $this->getContainer()->getParameter('kernel.bundles'); return array_filter($bundles, function ($value) { return StringUtil::startsWith($value, 'KupShop') || StringUtil::startsWith($value, 'Shop') || StringUtil::startsWith($value, 'External'); }); } public function getBundlesResource($path) { return Mapping::withKeys($this->getBundles(), function ($bundle, $tmp) use ($path) { return "@{$bundle}/{$path}"; }); } public function getBundlesPath($path) { return Mapping::withKeys($this->getBundles(), function ($bundle, $class) use ($path) { $bundles = $this->getContainer()->getParameter('kernel.bundles_metadata'); return $bundles[$bundle]['path'].'/'.$path; }); } public function getExistingBundlesPath($path) { $bundles = $this->getBundlesPath($path); $files = array_filter($bundles, function ($value) { return file_exists($value); }); return $files; } /** * @param Container $container * * @return BundleFinder */ public function setContainer($container) { $this->container = $container; return $this; } /** * @return Container */ public function getContainer() { if ($this->container) { return $this->container; } return $this->container = ServiceContainer::getContainer(); } }