@param PhpFileInfo $file

@return TableCell[]
334159
protected function getFileHeader(PhpFileInfo $file)
    {
        $cell = new TableCell(
            sprintf('<comment>%s</comment>', $file->getPathname()),
            array('colspan' => 3)
        );

        return array(new TableCell(), $cell);
    }
607335
public static function parseFile($file)
    {
        if (!file_exists($file) || !is_readable($file)) {
            $message = "crontab config file is not exists or not readable";
            throw new \RuntimeException($message);
        }

        $tasks = array();
        $lines = file($file);
        foreach ($lines as $line) {
            $job = new JobParse($line);
            $tasks[] = $job->getTask();
        }

        return $tasks;
    }
828569
public function run(string $file, Node $node): array
    {
        if ($this->isFunctionCall($node, 'json_decode')) {
            $options = $node->children['args']->children[3] ?? null;
            if ($this->shouldCheckOption($options) && !$this->isIncludeJSONThrowOnErrorOption($options)) {
                return [new Hint(
                    self::HINT_TYPE,
                    self::HINT_MESSAGE,
                    $file,
                    $node->lineno,
                    self::HINT_LINK
                )];
            }
        }
        if ($this->isFunctionCall($node, 'json_encode')) {
            $options = $node->children['args']->children[1] ?? null;
            if ($this->shouldCheckOption($options) && !$this->isIncludeJSONThrowOnErrorOption($options)) {
                return [new Hint(
                    self::HINT_TYPE,
                    self::HINT_MESSAGE,
                    $file,
                    $node->lineno,
                    self::HINT_LINK
                )];
            }
        }

        return [];
    }
815297
protected function readFile(string $file) : array
    {
        if (!file_exists($file)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Configuration %s is not exists',
                    $file
                ),
                E_WARNING
            );
        }

        if (!is_array(($configs = $this->parseFromFile($file)))) {
            throw new \RuntimeException(
                sprintf(
                    'Invalid %s configuration from file: %s',
                    ltrim(strrchr(get_class($this), '\\'), '\\'),
                    $file
                ),
                E_NOTICE
            );
        }

        return $configs;
    }
262383
protected function loadMappingFile($file)
    {
        $result     = [];
        $xmlElement = simplexml_load_file($file);

        if (isset($xmlElement->entity)) {
            foreach ($xmlElement->entity as $entityElement) {
                $entityName          = (string) $entityElement['name'];
                $result[$entityName] = $entityElement;
            }
        }

        return $result;
    }
903942
function readFile($file)
	{
		$fh = @fopen($file, 'r');

		$lines = false;
		if ($fh !== false) {
			$lines = array();
			while (!feof($fh)) {
				$lines[] = fgets($fh);
			}
			fclose($fh);
		}
		return $lines;
	}
905275
public function loadFile(string $file) : array
    {
        if (!file_exists($file)) {
            throw new LoaderException("Requested YAML file '{$file}' doesn't exist");
        }

        if (!$this->forceSymfony && $this->hasExtension) {
            $data = yaml_parse_file($file);
        } else {
            $data = Yaml::parse(file_get_contents($file));
        }

        if (!is_array($data)) {
            throw new LoaderException("Requested YAML file '{$file}' does not parse to an array");
        }

        return $data;
    }
490732
private function getTranslationArrayFromFile($file)
    {
        $extension = pathinfo($file, PATHINFO_EXTENSION);
        switch ($extension) {
            default:
                return [];
            case 'php':
                $loader = new Loader\PhpArrayTranslationsLoader($file);
                break;
        }

        return $loader->getTranslationArray();
    }
1240991
public function loadFile($file)
    {
        if ($this->enableSpyc()) {
            if (! file_exists($file)) return [];

            // parse environment
            $content = file_get_contents($file);
            $content = $this->parseEnvironmentVariables($content);

            return $this->loadBySpyc($content);
        } else {
            throw new NotFoundException('Not found YAML parser.');
        }
    }
859657
private function _getClassFiles($file)
    {
        $classes = array();
        $namespace = 0;
        $tokens = token_get_all(file_get_contents($file));
        $count = count($tokens);
        $dlm = false;
        for ($i = 2; $i < $count; $i++) {
            if ((isset($tokens[$i - 2][1]) && ($tokens[$i - 2][1] == "phpnamespace" || $tokens[$i - 2][1] == "namespace")) ||
                ($dlm && $tokens[$i - 1][0] == T_NS_SEPARATOR && $tokens[$i][0] == T_STRING)) {
                    if (!$dlm) $namespace = 0;
                    if (isset($tokens[$i][1])) {
                        $namespace = $namespace ? $namespace . "\\" . $tokens[$i][1] : $tokens[$i][1];
                        $dlm = true;
                    }
                } elseif ($dlm && ($tokens[$i][0] != T_NS_SEPARATOR) && ($tokens[$i][0] != T_STRING)) {
                $dlm = false;
            }
            if (($tokens[$i - 2][0] == T_CLASS || (isset($tokens[$i - 2][1]) && $tokens[$i - 2][1] == "phpclass"))
                && $tokens[$i - 1][0] == T_WHITESPACE && $tokens[$i][0] == T_STRING) {
                    $class_name = $tokens[$i][1];
                    if (!isset($classes[$namespace])) $classes[$namespace] = array();
                    $classes[$namespace][] = $class_name;
                }
        }

        return $classes;

    }
1280935
public function loadTranslation($file)
    {
        $translations = &gplcart_static("translation.$file");

        if (isset($translations)) {
            return (array) $translations;
        }

        $translations = array();

        if (empty($file) || !is_file($file)) {
            return $translations = array();
        }

        foreach ($this->parseCsv($file) as $row) {
            $key = array_shift($row);
            $translations[$key] = $row;
        }

        return $translations;
    }
742397
protected function parse(\SplFileInfo $file): array
    {
        try {
            $config = \Toml::parseFile($file->getRealPath());
        } catch (\Exception $e) {
            throw new ConfigurationParseException('Unable to parse config file: ' . $e->getMessage());
        }

        return $config;
    }
218036
public function fileinfo($file, $language = 'de')
    {
        if (!$file) {
            return [];
        }

        $parts = explode(';', $file);
        $fileId = $parts[0];

        $volume = $this->volumeManager->getByFileId($fileId);
        $file = $volume->findFile($fileId);

        if (!$file) {
            return [];
        }

        $attributes = $file->getAttributes();

        $info = [
            'name' => $file->getName(),
            'mimetype' => $file->getMimeType(),
            'mediaCategory' => $file->getMediaCategory(),
            'mediaType' => $file->getMediaType(),
            'size' => $file->getSize(),
            'attributes' => !empty($attributes['fileattributes']) ? $attributes['fileattributes'] : array(),
            'createdAt' => $file->getCreatedAt(),
            'modifiedAt' => $file->getModifiedAt(),
            'meta' => [],
        ];

        $metasets = $this->metaSetResolver->resolve($file);
        $meta = array();
        foreach ($metasets as $metaset) {
            $metadata = $this->metaDataManager->findByMetaSetAndFile($metaset, $file);
            $data = [];
            foreach ($metaset->getFields() as $field) {
                $value = '';
                if ($metadata) {
                    $value = $metadata->get($field->getName(), $language);
                }
                $data[$field->getName()] = $value;
            }
            $meta[$metaset->getName()] = $data;
        }

        $info['meta'] = new MetaSetAccessor($meta);

        return $info;
    }
217010
public function loadFile(string $file) : array
    {
        if (!file_exists($file)) {
            throw new LoaderException("Requested JSON file '{$file}' doesn't exist");
        }

        $contents = file_get_contents($file);
        if ($contents === false) {
            throw new LoaderException("Could ont succesfully load requested JSON file '{$file}'");
        }

        $data = json_decode($contents, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new LoaderException(sprintf("Could not load the JSON file '%s': %s", $file, json_last_error_msg()));
        }

        if (!is_array($data)) {
            throw new LoaderException(sprintf("JSON file '%s' did not parse to an array", $file));
        }

        return $data;
    }
506659
protected function parseFile($file)
    {
        $stmts = $this->phpParser->parse(file_get_contents($file));

        $visitor = new RefVisitor($file);
        $this->traverser->addVisitor($visitor);
        $this->traverser->traverse($stmts);
        $this->traverser->removeVisitor($visitor);

        return $visitor->getClasses();
    }
701269
private function hashFile(File $file)
    {
        $arr = [];

        foreach ($this->layouts as $layout) {
            if (strpos($layout, '_templates') === false) {
                $layout = '_templates'.DIRECTORY_SEPARATOR.$layout;
            }

            $layoutPathName = $this->sourceDirectory.DIRECTORY_SEPARATOR.$layout.'.phtml';
            if (file_exists($layoutPathName)) {
                array_push($arr, sha1_file($layoutPathName));
            }
        }

        array_push($arr, $file->getLastModified());

        return sha1(implode('.', $arr));
    }
1138718
public static function extractFilesDataFromFilesArray(array $file)
    {
        if (!isset($file['tmp_name'])) {
            return [];
        }
        
        $files = [];
        if (is_array($file['tmp_name'])) {
            foreach ($file['tmp_name'] as $index => $value) {
                // skip empty or none exsting tmp file names
                if (!isset($file['tmp_name'][$index]) || empty($file['tmp_name'][$index])) {
                    continue;
                }
                // create files structure array
                $files[] = [
                    'name' => $file['name'][$index],
                    'type' => $file['type'][$index],
                    'tmp_name' => $file['tmp_name'][$index],
                    'error' => $file['error'][$index],
                    'size' => $file['size'][$index],
                ];
            }
        } elseif (isset($file['tmp_name']) && !empty($file['tmp_name'])) {
            $files[] = [
                'name' => $file['name'],
                'type' => $file['type'],
                'tmp_name' => $file['tmp_name'],
                'error' => $file['error'],
                'size' => $file['size'],
            ];
        }
        
        return $files;
    }