Loads entites from file, does _not_ persist them.

@param array $files
@param string $type
@return array
345434
public function loadFiles(array $files, $type = 'yaml')
    {
        $set = $this->createFixtureSet();
        foreach ($files as $file) {
            $set->addFile($file, $type);
        }
        $set->setDoPersist(false);

        return $this->load($set);
    }
759871
public function createUploadedFiles(array $files){
        $instances = [];

        foreach($files as $name => $value){
            if($value instanceof UploadedFileInterface){
                $instances[$name]  = $value;
                continue;
            }

            if(!is_array($value)){
                $class  = UploadedFileInterface::class;

                throw new \InvalidArgumentException(
                    "The file list must be an associative array whose value is"
                    . " an instance of a class implementing {$class} or an array"
                    . " having file information."
                    . " But the value of index A does not apply to them."
                );
            }

            $instances[$name]  = isset($value["error"]) && isset($value["tmp_name"])
                ? $this->createUploadedFileWithNest($value)
                : $this->createUploadedFiles($value)
            ;
        }

        return $instances;
    }
552337
protected function setUploadedFiles(array $files)
    {
        $validate = function ($files) use (&$validate) {
            foreach ($files as $item) {
                if (is_array($item)) {
                    $validate($item);
                    continue;
                }
                if (! $item instanceof UploadedFileInterface) {
                    throw new InvalidArgumentException(
                        'Invalid structure of uploaded files provided.'
                    );
                }
            }
        };
        $validate($files);
        $this->uploadedFiles = $files;

        return $this;
    }
138452
public function load($resource, $type = null)
    {
        if (! is_file($resource)) {
            throw new InvalidArgumentException(sprintf('File "%s" is not a regular file.', $resource));
        }

        /* Checking file readability before hand to ensure getting its contents never fail. */
        if (! is_readable($resource)) {
            throw new InvalidArgumentException(sprintf('File "%s" is not readable.', $resource));
        }

        /* Explicitly reading file's content, because support for passing file names is deprecated since Symfony 2.8. */
        $content = file_get_contents($resource);
        $parsedYaml = Yaml::parse($content);

        if (! is_array($parsedYaml)) {
            throw new InvalidArgumentException(sprintf('Could not parse Yaml of file "%s"', $resource));
        }

        return $parsedYaml;
    }
395982
protected function validateTypeCache($type, $files)
    {
        // If the files isn't cached we have to cache the file
        $hash = $this->getTypeHash($type);
        if (!isset($this->cachedFiles[$hash])) {
            return false;
        } 
        
        $data = $this->cachedFiles[$hash];
        $checksums = $data['checksums'];

        // Are all files existing?
        foreach ($files as $file) {
            if (!file_exists($file->getFileName())) {
                return false;
            }
            
            $fileHash = $this->getHash($file->getFileName());
            $contentHash = md5_file($file->getFileName());
            if (!isset($checksums[$fileHash]) || $contentHash !== $checksums[$fileHash]) {
                return false;
            }
        }
        
        return true;
    }
347348
protected function getFiles(array $files)
    {
        $filesEntity = [];

        foreach ($files as $file) {
            $filesEntity[] = new File($file);
        }

        return $filesEntity;
    }
1051047
protected function listFiles($type)
    {
        if (!isset($this->cache['files'][$type])) {
            $path = sprintf('%s/%s', $this->directory, $type);

            if (!$this->files->exists($path)) {
                throw new Exception(sprintf(
                    'No content directory found for type "%s" (in "%s").',
                    $type,
                    $this->directory
                ));
            }

            $finder = new Finder();

            $this->cache['files'][$type] = $finder->files()->in($path);
        }

        return clone $this->cache['files'][$type];
    }
989847
public function load($resource, $type = null)
    {
        $config = include $resource;

        if (!is_array($config)) {
            throw new \InvalidArgumentException(
                sprintf('The file "%s" did not return a valid PHP array when included', $resource)
            );
        }

        return $config;
    }
745815
protected function filterByType(string $type)
    {
        if (!$this->files) {
            return new Sequence();
        }

        return new Sequence(
            array_filter(
                $this->files,
                function (StatusFile $statusFile) use ($type) {
                    return $type === $statusFile->getIndexStatus();
                }
            )
        );
    }
181189
public static function normalizeFilesArray(array $files): array
    {
        $return = [];
        foreach ($files as $i => $file) {
            foreach ($file as $key => $value) {
                $return[$key][$i] = $value;
            }
        }

        return $return;
    }
861722
protected function setUploadedFiles(self $object, array $files)
    {
        $object->files = [];
        foreach($files as $key => $file)
        {
            $object->files[$key] = new UploadedFile($file['name'], $file['type'], $file['tmp_name'], $file['size'], $file['error']);
        }
        return $object;
    }
553050
public static function loadRoutingFiles(array $files)
    {
        $routing = new Structure();

        foreach ($files as $file) {
            if (!in_array(pathinfo($file, PATHINFO_EXTENSION), ['json', 'yml', 'yaml'])) {
                continue;
            }

            $routing = $routing->loadFile($file, pathinfo($file, PATHINFO_EXTENSION));
        }

        return $routing->toArray();
    }
201611
private function loadFiles($files)
    {
        $final_files = $this->getFiles($files);
        if (!$final_files) {
            $this->exception('缺少可用文件', $files);
        }
        //加载规则文件
        foreach ($final_files as $file) {
            include $file;
        }
        return $final_files;
    }
1180084
final protected function canLoadAsset($file, $type) {
        $filename = basename($file);
        if (in_array($filename, $this->loadedAssets[$type]))
            return false;

        $this->loadedAssets[$type][] = $filename;
        return true;
    }
322143
public static function require(String $file, String $type = 'require')
    {
        $file = Info::rpath($file);

        if( ! is_file($file) )
        {
            throw new Exception\FileNotFoundException(NULL, $file);
        }

        switch( $type )
        {
            case 'require'     : return require      $file;
            case 'require_once': return require_once $file;
            case 'include'     : return include      $file;
            case 'include_once': return include_once $file;
        }
    }
359853
public function loadComponents (ComponentType $type) : array
    {
        $path = "{$this->templatesDir}/{$type->getDirectory()}";

        if (!is_dir($path) || !is_readable($path))
        {
            return [];
        }

        $finder = new Finder();
        $files = $finder
            ->files()
            ->in($path)
            ->depth("== 0")
            ->name("*.html.twig")
            ->sortByName();

        $result = [];

        foreach ($files as $file)
        {
            $component = new Component($file, $this->templatePrefix, $type);
            $result[$component->getKey()] = $component;
        }

        return $result;
    }
1128881
public function load($file, $type = null)
    {
        $path = $this->locator->locate($file);

        $xml = $this->parseFile($path);
        $xml->registerXPathNamespace('config', 'http://thelia.net/schema/dic/config');

        $this->removeScope($xml);

        $this->container->addResource(new FileResource($path));

        $this->parseLoops($xml);

        $this->parseFilters($xml);

        $this->parseTemplateDirectives($xml);

        $this->parseParameters($xml);

        $this->parseCommands($xml);

        $this->parseForms($xml);

        $this->parseDefinitions($xml, $path);

        $this->parseHooks($xml, $path, $type);

        $this->propelOnlyRun(
            [$this, "parseExportCategories"],
            $xml
        );

        $this->propelOnlyRun(
            [$this, "parseExports"],
            $xml
        );

        $this->propelOnlyRun(
            [$this, "parseImportCategories"],
            $xml
        );

        $this->propelOnlyRun(
            [$this, "parseImports"],
            $xml
        );
    }