@param BundleInterface[]    $bundles
@param string[]|string|null $directory
@param string|null          $type

@return string[]
511294
public function findClasses($bundles, $directory = '', $type = '')
    {
        $finder = Finder::create()->files()->name('*.php')->sortByName()->ignoreUnreadableDirs();
        $found  = false;

        foreach ($bundles as $bundle) {
            $path = rtrim($bundle->getPath(), DIRECTORY_SEPARATOR);

            if (true === empty($directory)) {
                $found = true;
                $finder->in($path);
                continue;
            }

            if (false === is_array($directory)) {
                $directory = [$directory];
            }

            foreach ($directory as $dir) {
                $pathname = sprintf('%s%s%s', $path, DIRECTORY_SEPARATOR, trim($dir, DIRECTORY_SEPARATOR));
                if (true === is_dir($pathname)) {
                    $found = true;
                    $finder->in($pathname);
                }
            }
        }

        if (false === $found) {
            return [];
        }

        $files = [];
        foreach ($finder as $file) {
            $files[] = $file->getPathname();
        }

        $classes = [];
        foreach ($files as $file) {
            foreach ($bundles as $bundle) {
                if (null !== $class = $this->getClassFromFileAndBundle($file, $bundle)) {
                    $classes[] = $class;
                    continue;
                }
            }
        }

        $classes = array_filter($classes, function ($e) {
            return class_exists($e);
        });

        if (false === empty($type)) {
            if (false === (class_exists($type) || interface_exists($type))) {
                throw new \InvalidArgumentException(sprintf('Class or interface "%s" unknown', $type));
            }
            $classes = array_filter($classes, function ($e) use ($type) {
                return is_subclass_of($e, $type);
            });
        }

        return $classes;
    }
416720
@Override
	public void processBundles(GlobalPreprocessingContext ctx, List<JoinableResourceBundle> bundles) {

		ResourceReaderHandler rsHandler = ctx.getRsReaderHandler();

		Set<String> resourcePaths = getResourcePaths(bundles);
		JawrConfig jawrConfig = ctx.getJawrConfig();
		Charset charset = jawrConfig.getResourceCharset();

		BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) jawrConfig.getContext()
				.getAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);

		generateSprites(rsHandler, binaryRsHandler, resourcePaths, jawrConfig, charset);

		// Update CSS resource handler
		CssSmartSpritesResourceReader cssSpriteResourceReader = new CssSmartSpritesResourceReader(
				rsHandler.getWorkingDirectory(), jawrConfig);

		updateBundlesDirtyState(bundles, cssSpriteResourceReader);

		ctx.getRsReaderHandler().addResourceReader(cssSpriteResourceReader);

		// Update image resource handler
		ResourceReaderHandler imgStreamRsHandler = binaryRsHandler.getRsReaderHandler();
		imgStreamRsHandler.addResourceReader(cssSpriteResourceReader);
	}
1198183
public static function getLocales(string $bundle) :array {

		// declare an array to hold the list
		$locales = array();
		// set the locales path
		$locales_path = "../Private/Bundles/{$bundle}/Locales/";
		// if the directory exists
		if(file_exists($locales_path) && is_dir($locales_path)) {
			// for each file in the directory
			foreach(scandir($locales_path) as $locales_file) {
				// if the file is a normal one
				if(substr($locales_file,0,1) != '.' ) {
					// push it into the array of locales
					$locales[] = $locales_path . $locales_file ;
				}
			}
		}
		// return all found locales
		return($locales);
		
	}
859913
function writeBundles(done) {
		debug('writeBundles()');
		async.forEachSeries(incBundles, function(packet, next) {
			packet.write(options, next);
		}, done);
	}
1342794
protected function getRequiredYvesBundleCodeGenerators($bundle)
    {
        return [
            $this->createYvesIndexControllerCodeGenerator($bundle),
            $this->createYvesIndexControllerProviderCodeGenerator($bundle),
            $this->createYvesIndexIndexTemplateCodeGenerator($bundle),
            $this->createYvesFactoryCodeGenerator($bundle),
        ];
    }
878394
protected function resolveAndReturnBundleDependencies(
        KernelInterface $kernel,
        array $bundles
    ): array {
        $bundleStack = [];
        $visitedBundles = [];
        $this
            ->resolveBundleDependencies(
                $kernel,
                $bundleStack,
                $visitedBundles,
                $bundles
            );

        return $bundleStack;
    }
22783
protected function getMessage($bundle, $key, $language)
    {
        $keyRecord = $this->getKeyRepository()->findOneBy(array(
                'project'  => $this->project,
                'bundle'   => $bundle,
                'key'      => $key,
            )
        );

        if(!$keyRecord){
            return null;
        }
        /** @var Message $message */
        $message = $this->getMessageRepository()->findOneBy(array(
                'key'      => $keyRecord,
                'language' => $language,
            )
        );
        return $message;
    }
827632
public function generateMigrationQueries(Bundle $bundle, AbstractPlatform $platform)
    {
        $schemas = $this->getSchemas();
        $fromSchema = $schemas['fromSchema'];
        $toSchema = $schemas['toSchema'];

        $bundleTables = $this->getBundleTables($bundle, $schemas['metadata']);
        $this->filterSchemas(array($fromSchema, $toSchema), $bundleTables);

        $upQueries = $fromSchema->getMigrateToSql($toSchema, $platform);
        $downQueries = $fromSchema->getMigrateFromSql($toSchema, $platform);

        return array(
            self::QUERIES_UP => $upQueries,
            self::QUERIES_DOWN => $downQueries
        );
    }
161708
public void setBundles(java.util.Collection<WorkspaceBundle> bundles) {
        if (bundles == null) {
            this.bundles = null;
            return;
        }

        this.bundles = new com.amazonaws.internal.SdkInternalList<WorkspaceBundle>(bundles);
    }
1038631
private function encodeBundle(ResourceBundleInterface $bundle): array
    {
        $encodedBundle = [];
        foreach ($bundle->getKeys() as $key) {
            $encodedBundle[$key] = $this->getBundleValue($bundle, (string)$key);
        }

        return $encodedBundle;
    }
1116202
protected function Modules($bundle)
    {
        $modules = PathUtil::BackendModules($bundle);
        $result = array();
        foreach ($modules as $module)
        {
            $instance = ClassFinder::CreateBackendModule(ClassFinder::CalcModuleType($bundle, $module));
            if ($instance instanceof BackendModule)
            {
                $result[] = $module;
            }
        }
        return $result;
    }
553985
public static function file($bundle, $view, $directory)
	{
		$directory = str_finish($directory, DS);

		// Views may have either the default PHP file extension or the "Blade"
		// extension, so we will need to check for both in the view path
		// and return the first one we find for the given view.
		if (file_exists($path = $directory.$view.EXT))
		{
			return $path;
		}
		elseif (file_exists($path = $directory.$view.BLADE_EXT))
		{
			return $path;
		}
	}
1280331
protected function getRequiredClientBundleCodeGenerators($bundle)
    {
        return [
            $this->createClientDependencyProviderCodeGenerator($bundle),
            $this->createClientFactoryCodeGenerator($bundle),
            $this->createClientCodeGenerator($bundle),
            $this->createClientInterfaceCodeGenerator($bundle),
            $this->createStubCodeGenerator($bundle),
            $this->createStubInterfaceCodeGenerator($bundle),
            $this->createGatewayControllerCodeGenerator($bundle),
        ];
    }
366918
@Override
	protected List<JoinableResourceBundle> filterBundlesToRender(List<JoinableResourceBundle> bundles) {
		List<JoinableResourceBundle> filteredBundles = new ArrayList<>();
		for (JoinableResourceBundle bundle : bundles) {
			if (bundle.getInclusionPattern().isIncludeOnDebug()) {
				filteredBundles.add(bundle);
			}
		}
		return filteredBundles;
	}
732418
public function getAttributeIds($bundle = null)
    {
        $attributes = $this->attributes($bundle);
        $ids = [];

        foreach ($attributes as $name => $info) {
            $ids[] = $info['id'];
        }

        return $ids;
    }
1015928
protected List<JoinableResourceBundle> filterBundlesToRender(List<JoinableResourceBundle> bundles) {
		List<JoinableResourceBundle> filteredBundles = new ArrayList<>();
		for (JoinableResourceBundle bundle : bundles) {
			if (!bundle.getInclusionPattern().isIncludeOnlyOnDebug()) {
				filteredBundles.add(bundle);
			}
		}
		return filteredBundles;
	}
787915
private void updateBundlesDirtyState(List<JoinableResourceBundle> bundles,
			CssSmartSpritesResourceReader cssSpriteResourceReader) {

		for (JoinableResourceBundle bundle : bundles) {

			List<BundlePath> bundlePaths = bundle.getItemPathList();
			for (BundlePath bundlePath : bundlePaths) {
				String path = bundlePath.getPath();
				File stdFile = cssSpriteResourceReader.getGeneratedCssFile(path);
				File bckFile = cssSpriteResourceReader.getBackupFile(path);
				if (bckFile.exists()) {
					try {
						if (!FileUtils.contentEquals(stdFile, bckFile)) {
							bundle.setDirty(true);
							break;
						}
					} catch (IOException e) {
						throw new BundlingProcessException("Issue while generating smartsprite bundle", e);
					}
				}
				cssSpriteResourceReader.getResource(bundle, path);
			}
		}
	}