@param $file

@return Retorno
@throws \Exception
170240
public static function make($file)
    {
        if (!$file_content = Util::file2array($file)) {
            throw new \Exception("Arquivo: não existe");
        }

        if (!Util::isHeaderRetorno($file_content[0])) {
            throw new \Exception("Arquivo: $file, não é um arquivo de retorno");
        }

        $instancia = self::getBancoClass($file_content);
        return $instancia->processar();
    }
657936
public function load($file) {
		$this->_origin = $file;
		if(!is_null($file)) {
			if(file_exists($file)) {
				if (is_null($this->_name)) {
					$bits = explode('/', $file);
					$this->_name = preg_replace('~\.tmpl~', '', array_pop($bits));
				}
				$this->_contents = file_get_contents($file);
				$this->_dir = dirname($file);
			}
			else {
				throw new \InvalidArgumentException("file does not exist (". $file .")");
			}
		}
		return $this;
	}
644719
public function file( $file = null )
	{
		if ( !is_null( $file ) )
		{
			return $this->_file = $file;
		}
		
		return $this->_file;
	}
903058
public function loadConfig(string $file): self
    {
        if (file_exists($file) === false) {
            throw new \RuntimeException('No such config file.');
        }
        $data = json_decode(file_get_contents($file), true);
        if ($data === null) {
            throw new \RuntimeException('Invalid config file.');
        }
        return $this->setConfigs($data);
    }
277821
public function toFile($file)
	{
		$minified = $this->minify();

		// Create dir
		$dir = dirname($file);

		if (!is_dir($dir))
		{
			if (is_file($dir))
			{
				throw new \RuntimeException(sprintf('Path: %s is already a file.', $dir));
			}

			if (!@mkdir($dir, 0755, true) && !is_dir($dir))
			{
				throw new \RuntimeException(sprintf('Auto create dir: %s fail.', $dir));
			}
		}

		file_put_contents($file, $minified);

		return $this;
	}
1369795
private function loadFile($file)
    {
        Assertion::file($file, 'Can\'t parse config file. File does not exist: ' . $file);

        $array = $this->parseConfigFile($file);
        $array = $this->doReplacements($array);

        return new Config($array);
    }
605094
public static function createFromFile($file)
    {
        if (!is_readable($file)) {
            throw new InvalidArgumentException('Unreadable file');
        }

        return new self(Yaml::parse(file_get_contents($file)));
    }
1333565
public function setFile($file)
    {
        if (empty($file) || false === stream_resolve_include_path($file)) {
            throw new Exception\InvalidArgumentException('Invalid options to validator provided');
        }

        $this->options['file'] = $file;
        return $this;
    }
1370420
public function read($file)
    {
        $document = new \DOMDocument();
        $errorToExceptionContext = new ErrorToExceptionContext(E_WARNING, function () use ($file, $document) {
            $document->load($file);
        });
        $errorToExceptionContext->invoke();

        return $this->readDocument($document, pathinfo($file, PATHINFO_FILENAME));
    }
270095
final public static function getFromFile($file)
    {
        if (!is_readable($file)) {
            throw new FileNotFoundException;
        }

        $fp    = fopen($file, 'r');
        $class = $namespace = $buffer = '';
        $i     = 0;
        while (!$class) {
            if (feof($fp)) {
                break;
            }

            $buffer .= fread($fp, 512);
            $tokens = @token_get_all($buffer);

            if (strpos($buffer, '{') === false) {
                continue;
            }
            $total = count($tokens);
            for (; $i < $total; $i++) {
                if ($tokens[$i][0] === T_NAMESPACE) {
                    for ($j = $i + 1; $j < count($tokens); $j++) {
                        if ($tokens[$j][0] === T_STRING) {
                            $namespace .= '\\' . $tokens[$j][1];
                        } else if ($tokens[$j] === '{' || $tokens[$j] === ';') {
                            break;
                        }
                    }
                } elseif ($tokens[$i][0] === T_CLASS) {
                    for ($j = $i + 1; $j < count($tokens); $j++) {
                        if ($tokens[$j] === '{') {
                            $class = $tokens[$i + 2][1];
                            break;
                        }
                    }
                    break;
                }
            }
        }
        fclose($fp);
        if (!$class) {
            throw new InvalidClassException;
        }
    
        return $namespace . '\\' . $class;
    }
784127
public static function deserializeFromFile($file)
  {
    if (file_exists($file))
    {
      $serialized_data = file_get_contents($file);
      return unserialize($serialized_data);
    }
    else return null;
  }
1215418
public function setFile($file)
    {
        $path = pathinfo((string) $file);

        if (!$path['extension'])
            $file .= '.'.static::$_defaultExt;

        $this->_file = trim($file, DIRECTORY_SEPARATOR);

        return $this;
    }
154295
public function getAction($file)
    {
        if (!is_dir($this->source_directory) || !isset($this->file_extension, $this->response_type)) {
            throw new Exception("Controller is not configured!");
        }
        $source_file = $this->source_directory . "/" . $file . "." . $this->file_extension;
        if (!is_readable($source_file)) {
            throw new Error404Exception;
        }
        $this->response->setHeader("Content-Type", $this->response_type);
        return $this->view->display($source_file);
    }
446627
public function getRevFile($file)
    {
        $map = $this->getRevMap();
        if (isset($map[$file])) {
            $index = strrpos($file, '.');
            $file = $this->revPrefix . substr($file, 0, $index) . '-' . $map[$file] . substr($file, $index);
        }

        return $file;
    }
357662
public function check(File $file)
    {
        if ($file->getUid() !== $this->uid) {
            throw new \Exception('This CachedFile is not for uid ['.$file->getUid().']');
        }

        return $this->hash === $this->hashFile($file);
    }
558508
protected function getFileFinder($file) {
    return new class($file) implements ClassFinderInterface {

      protected $file;

      public function __construct($file) {
        $this->file = $file;
      }

      public function findFile($class) {
        return $this->file;
      }
    };
  }
209695
public function loadFile($file)
    {
        if (!file_exists($file)) {
            throw new LoaderException("Requested file '{$file}' doesn't exist");
        }

        $data = include($file);

        if (!is_array($data)) {
            throw new LoaderException("Requested file '{$file}' is expected to return an array");
        }

        return $data;
    }