@param ExtendedFileInterface $file

@return array
164607
private function findStatusByFile(ExtendedFileInterface $file)
    {
        $qb = $this->fileUsageRepository->createQueryBuilder('u');
        $qb
            ->select('u.status')
            ->join('u.file', 'f')
            ->where($qb->expr()->eq('f.id', $qb->expr()->literal($file->getId())))
            ->andWhere($qb->expr()->eq('f.version', $qb->expr()->literal($file->getVersion())));

        return array_column($qb->getQuery()->getScalarResult(), 'status');
    }
852008
public static function get(String $file) : stdClass
    {
        $file = self::rpath($file);

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

        return (object)
        [
            'basename'   => self::pathInfo($file, 'basename'),
            'size'       => filesize($file),
            'date'       => filemtime($file),
            'readable'   => is_readable($file),
            'writable'   => is_writable($file),
            'executable' => is_executable($file),
            'permission' => fileperms($file)
        ];
    }
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;
    }
105220
private function _getTranslators($file)
    {
        $subject = file_get_contents($file);
        preg_match_all($this->module->patternArrayTranslator, $subject, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
        $translators = [];
        foreach ($matches as $data) {
            if (isset($data['translator'][0])) {
                $translators[$data['translator'][0]] = true;
            }
        }

        return array_keys($translators);
    }
887606
protected function handleMultipleFile($file) : array
    {
        $fileBag = [];

        foreach ($file['name'] as $idx => $name) {
            $uploadedFile = null;

            //The current file was uploaded successfully?
            if (!$file[$idx]['error']) {
                $uploadedFile = new UploadedFile(
                    $file[$idx]['tmp_name'],
                    $file[$idx]['name'],
                    $file[$idx]['type']
                );
            }

            $fileBag[$idx] = $uploadedFile;
        }

        return $fileBag;
    }
955994
public function parse(string $file): array
    {
        if (false === file_exists($file)) {
            throw InvalidArgumentExceptionFactory::createForFileCouldNotBeFound($file);
        }

        try {
            $data = json_decode(file_get_contents($file), true);

            if (null === $data) {
                throw ParseExceptionFactory::createForInvalidJson($file);
            }

            return $data;
        } catch (\Exception $exception) {
            if ($exception instanceof UnparsableFileException) {
                throw $exception;
            }

            throw ParseExceptionFactory::createForUnparsableFile($file, 0, $exception);
        }
    }
223214
public static function parseFile($filename, & $extendedFiles = null)
	{
		$schema = static::annotateSchema(Utils::parse_json_file($filename), false);
		$extends_file = isset($schema['extends_file']) ? dirname($filename).'/'.$schema['extends_file'] : null;
		while ($extends_file !== null) {
			if ($extendedFiles !== null) {
				$extendedFiles[] = $extends_file;
			}
			$part = static::annotateSchema(Utils::parse_json_file($extends_file),
					str_replace('.schema.json', '', basename($extends_file)));
			$extends_file = isset($part['extends_file']) ? dirname($extends_file).'/'.$part['extends_file'] : null;
			$schema = static::extendSchema($part, $schema);
		}
		if (isset($schema['extends_file'])) {
			unset($schema['extends_file']);
		}
		return $schema;
	}
1263121
public function transform(FileContract $file)
    {
        return [
            'id'        => $file->getId(),
            'name'      => $file->getName(),
            'mime_type' => $file->getMimeType(),
            'byte_size' => $file->getByteSize(),
            'data'      => $file->getData(),
            'saved_at'  => $file->getSavedAt(),
        ];
    }
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();
    }
894701
public static function parseYamlFile($file): array
    {
        if (file_exists($file)) {
            $data = file_get_contents($file);
            if (!empty($data)) {
                $data = static::replaceEnvVariables($data);
                return Yaml::parse($data);
            }
        }

        return [];
    }
1306200
protected static function loadFromFile(?string $file)
    {
        if ($file === null) {
            return [];
        }

        $ext = \strrchr($file, '.');
        if ($ext === '.yml' || $ext === '.yaml') {
            return static::loadYaml($file, $ext);
        }

        return require $file;
    }
626545
protected function getCacheKeys($file)
    {
        if (! file_exists($file)) {
            file_put_contents($file, null);
        }

        return json_decode(file_get_contents($file), true) ?: [];
    }
149519
static public function read($file) {
		if (! $file instanceof FileInterface) {
			$file = new File($file);
		}
		
		return static::parse($file->getContent());
	}
1217394
public function parse(string $file): array
    {
        foreach ($this->parsers as $parser) {
            if ($parser->canParse($file)) {
                return $parser->parse($file);
            }
        }

        throw ParseExceptionFactory::createForParserNoFoundForFile($file);
    }
743535
public function getAllowed($file)
    {
        $commands = array();

        foreach ($this->getHandlers() as $id => $command) {
            if ($this->isAllowed($command, $file)) {
                $commands[$id] = $command;
            }
        }

        return $commands;
    }
138278
protected static function convertFile($file)
    {
        $error = $file->getError();
        $tmpName = '';
        if ($error === UPLOAD_ERR_OK) {
            $tmpName = $file->getStream()->getMetadata('uri');
        }

        return [
            'name' => $file->getClientFilename(),
            'type' => $file->getClientMediaType(),
            'tmp_name' => $tmpName,
            'error' => $error,
            'size' => $file->getSize(),
        ];
    }
200207
private function getFileInfo(UploadedFile $file)
    {
        $fileManager = $this->get('tuna_cms_file.manager.file_manager');
        $filename = $fileManager->generateTmpFilename($file);

        return [
            'path' => $filename,
            'mimeType' => $file->getMimeType(),
            'originalName' => $file->getClientOriginalName(),
        ];
    }