@param \Jodit\File $file

@return \Jodit\File
772812
static function getThumb(File $file, Config $config) {
		$path = $file->getFolder();

		if (!is_dir($path . $config->thumbFolderName)) {
			mkdir($path . $config->thumbFolderName, 0777);
		}

		$thumbName = $path . $config->thumbFolderName . Consts::DS . $file->getName();
		if (!$file->isImage()) {
			$thumbName = $path . $config->thumbFolderName . Consts::DS . $file->getName() . '.png';
		}

		if (!file_exists($thumbName)) {
			if ($file->isImage()) {
				try {
					$img = new SimpleImage($file->getPath());
					$img
						->best_fit(150, 150)
						->save($thumbName, $config->quality);
				} catch (\Exception $e) {
					return $file;
				}
			} else {
				self::generateIcon($file, $thumbName);
			}
		}

		return new File($thumbName);
	}
546731
public function withFile($file)
    {
        if (!is_file($file)) {
            throw new \InvalidArgumentException('File: ' . $file . ' not exists.');
        }

        return $this->withFileStream(new Stream($file));
    }
398545
public static function asset(string $file)
  {
    $template = new Template();
    return file_get_contents($template->assets . $template->cleanPath($file));
  }
805911
private function replaceCwd($file)
    {
        $cwd = \getcwd();
        if ($cwd === false) {
            return $file;
        }

        $cwd = \rtrim($cwd, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        return \preg_replace('/^' . \preg_quote($cwd, '/') . '/', '', $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;
    }
902468
public static function make(string $file) : Route
  {
    $router = new Route;
    $router->file = $file;

    return $router;
  }
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;
    }
644719
public function file( $file = null )
	{
		if ( !is_null( $file ) )
		{
			return $this->_file = $file;
		}
		
		return $this->_file;
	}
1031215
public function getConfigFile($file = null)
    {
        $file = $file ?: $this->configFile;

        return file_exists($file) ? $file : $this->getConfigFileStub();
    }
66809
public function delete($file)
    {
        $file = $this->path($file);

        if (is_dir($file)) {
            return @rmdir($file);
        }

        return @unlink($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;
      }
    };
  }
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;
    }
514515
public function downloadFile(File $file): PromiseInterface
    {
        $url = 'https://api.telegram.org/file/bot' . $this->botToken . '/' . $file->file_path;
        $this->logger->debug('About to perform request to begin downloading file');

        return $this->requestHandler->get($url)->then(
            function (TelegramResponse $rawData) {
                return new TelegramDocument($rawData);
            }
        );
    }
716743
public function parse($file)
    {
        $this->file = $file;
        $this->validateSelf();
        $this->process->run("{$this->binary} {$this->file} -");

        return $this;
    }
889078
public function htmlMinify($file, $type = 'file')
    {
        $file = $this->getFile($file, $type);
        $file = $this->cleanSpaces($file);
        $file = $this->fixMaster($file);
        $file = $this->removeComments($file);

        return $file;
    }
1355230
public function createParentFolder($file)
    {
        if (! file_exists($folder = dirname($file))) {
            return mkdir(dirname($file), 0775, true);
        }
    }
741922
protected function createFromArray($file)
	{
		$file = new SymfonyUploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']);

		return $this->createFromObject($file);
	}