@param string $file

@return static
498711
public function load($file = '@config/app.php')
    {
        /** @noinspection PhpIncludeInspection */
        $data = require $this->alias->resolve($file);

        foreach ((array)$data as $field => $value) {
            if (!property_exists($this, $field)) {
                throw new NotSupportedException(['`:item` item is not allowed: it must be a public property of `configure` component', 'item' => $field]);
            }

            $this->$field = $value;
        }

        return $this;
    }
606829
public function setFile($file): self
    {
        $this->file = $file;

        if (is_string($file)) {
            $this->pathToFile = $file;
            $this->setFileName(pathinfo($file, PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file, PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof UploadedFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName($file->getClientOriginalName());
            $this->mediaName = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);

            return $this;
        }

        if ($file instanceof SymfonyFile) {
            $this->pathToFile = $file->getPath().'/'.$file->getFilename();
            $this->setFileName(pathinfo($file->getFilename(), PATHINFO_BASENAME));
            $this->mediaName = pathinfo($file->getFilename(), PATHINFO_FILENAME);

            return $this;
        }

        throw UnknownType::create();
    }
276777
public function setFile(File $file)
    {
        $this->file = $file;

        if ($this->file) {
            $this->updatedAt = new \DateTime('now');
        }

        return $this;
    }
1319221
public function add($file)
    {
        if ($file instanceof SplFileInfo) {
            throw InvalidArgumentException::create(
                sprintf(
                    '%1$s/FileBag|%1$s/File[]|%1$s/File',
                    __NAMESPACE__
                ),
                $file
            );
        }

        return parent::add($file);
    }
246948
public function add($file)
    {
        if ($file instanceof File) {
            throw InvalidArgumentException::create(
                sprintf(
                    '%1$s/FileBag|SplFileInfo[]|SplFileInfo',
                    __NAMESPACE__
                ),
                $file
            );
        }

        return parent::add($file);
    }
552317
public function withFile($file, $reset=false)
    {
        $file = str_replace('\\', '/', $file);
        if ($pos = strripos($file, $this->getOption('file_ext'))) {
            $file = substr($file, 0, $pos-1);
        }
        $dir = dirname($file);
        if (!isset(static::$instances[$dir])) {
            $instance = new static($this->options);
            $instance->setOption('file', $file);
            static::$instances[$dir] = $instance;
        }
        
        if ($reset) {
            $key = static::$instances[$dir]->getOption('file');
            static::$instances[$dir]->remove($key);
            static::$instances[$dir]->remove($key . '.error');
        }
        
        return static::$instances[$dir];
    }
982497
public function resolve($file)
    {
        $class = Str::studly(implode('_', array_slice(explode('_', $file), 4)));

        return new $class($this->output);
    }
597946
public static function create($name = null, $file = null, $url = null)
    {
        return new static($name, $file, $url);
    }
156093
public function setFile(File $file = null)
    {
        $this->file = $file;

        if (!empty($file)) {
            $size = @getimagesize($file->getPathname());

            if (is_array($size)) {
                list($this->width, $this->height) = $size;
            }

            $this->refreshUpdatedAt();
        }

        return $this;
    }
859083
public static function open($file)
    {
        if (is_string($file)) {
            $file = new \SplFileInfo($file);
        }
        if (!$file->isFile()) {
            throw new ImageException('image file not exist');
        }
        return new self($file);
    }
1321213
public function sendFile($file) {
		if ($this->sent) {
			return $this;
		}

		$this->setMode(self::MODE_FILE);
		$this->send($file);

		return $this;
	}
429907
public static function remove(string $file = ''): bool
    {
        $file = static::normalizePath($file);
        if (static::exists($file)) {
            return @\unlink($file);
        }
        return false;
    }
1287644
protected function ensureEloquentFile($file)
    {

        if (!$file instanceof EloquentFile) {
            throw new TypeException("File has to be EloquentFile not " . Type::of($file));
        }

        if ($this->urlMapper) {
            $file->setUrlMapper($this->urlMapper);
        }

        return $file;

    }
1169938
public function addRevFile($file)
    {
        // Load default rev file
        $this->getRevMap();

        if (is_file($file)) {
            $this->revMap = json_decode(file_get_contents($file), true) + $this->revMap;
        }

        return $this;
    }
351010
protected function setFileToLoad(string $file) : ModularParser
    {
        if (file_exists($file)) {
            $spl = new SplFileInfo($file);
            // check if is as a symlink
            if ($spl->isLink()) {
                throw new InvalidArgumentException(
                    "Argument that given could not as a symlink path.",
                    E_WARNING
                );
            }
            // check if as a file
            if (!$spl->isFile()) {
                throw new InvalidArgumentException(
                    "Argument that given is not a file.",
                    E_WARNING
                );
            }

            if (strtolower($spl->getExtension()) !== 'php') {
                throw new InvalidArgumentException(
                    sprintf(
                        "%s file has invalid extension. ExtensionParser must be as `php`",
                        $this->getName()
                    ),
                    E_WARNING
                );
            }

            $this->file = $spl->getRealPath();
            unset($spl);
            return $this;
        }

        throw new InvalidArgumentException(
            sprintf(
                "Invalid file %s to read.",
                $this->getName()
            ),
            E_WARNING
        );
    }
293592
static function fromYaml($file)
    {
        if (!file_exists($file)) {
            throw new \InvalidArgumentException("Config file '$file' not found.");
        }

        $values = Yaml::parse(file_get_contents($file));
        $config = new static($values, $file);

        return $config;
    }
565050
public function addStyle($file) {
        if (is_array($file)) {
            foreach ($file as $f) {
                if (!in_array($f, $this->sytles)) {
                    $this->sytles [] = $f;
                }
            }
        } else if (!in_array($file, $this->sytles)) {
            $this->sytles [] = $file;
        }

        return $this;
    }