Ensures the given filePath is readable.

@throws \InvalidArgumentException
498274
protected function ensureFileIsReadable()
    {
        $filePath = $this->filePath;
        if (!is_readable($filePath) || !is_file($filePath)) {
            throw new InvalidArgumentException(sprintf(
                'Dotenv: Environment file .env not found or not readable. '.
                'Create file with your environment settings at %s',
                $filePath
            ));
        }
    }
966454
protected function fileExistsAndReadable ()
	{
		if ($this->isDataStream === true)
		{
			return;
		}
		
		if (stristr($this->fileName, 'http://') !== false)
		{
			$this->remoteImage = true;
			return;
		}
		
		if (!file_exists($this->fileName))
		{
			$this->triggerError('Image file not found: ' . $this->fileName);
		}
		elseif (!is_readable($this->fileName))
		{
			$this->triggerError('Image file not readable: ' . $this->fileName);
		}
	}
1012918
protected function isFilesystemReadable(/*# string */ $path)/*# : bool */
    {
        if ($this->getFilesystem()->isReadable()) {
            return true;
        } else {
            return $this->setError(
                Message::get(Message::STR_FS_NONREADABLE, $path),
                Message::STR_FS_NONREADABLE
            );
        }
    }
962776
protected function checkFilePath($filePath)
	{
	    $filePath = rtrim($filePath, '/\\');
	    if (!is_dir($filePath)) {
			mkdir($filePath, 0755, true);
		}
        
		if (!is_writable($filePath)) {
			throw new \RuntimeException(sprintf('The base cache path `%s` is not writable.', $filePath));
		}

		return true;
	}
193019
public static function assertIsReadable(string $path, Throwable $exception): string
    {
        static::makeAssertion(\is_readable($path), $exception);
        return $path;
    }
413063
private function computeFilePublishDate($filepath)
    {
        $creationTimestamp = filectime($filepath);
        if (false === $creationTimestamp) {
            throw new \InvalidArgumentException("Could not get creation date of file $filepath");
        }
        $creationDateTime = new \DateTime('@' . $creationTimestamp);

        return $creationDateTime->format('Y-m-d');
    }
50146
protected function validate()
    {
        $realPath = $this->realPath();

        if (! $realPath) {
            throw new \InvalidArgumentException("Path can not be empty");
        }

        if (! file_exists($realPath)) {
            throw new PathNotFoundException("Path does not exist: [{$realPath}]");
        }

        if (! $this->composer('type')) {
            throw new \Exception('Composer type not provided in composer.json');
        }

        if (! str_is('*.*.*', $this->slug)) {
            throw new \Exception('Slug should be snake case and formatted like: {vendor}.{type}.{name}');
        }
    }
1113450
protected function setFilename($filename)
    {
        if (is_string($filename)) {
            if (is_readable($filename)) {
                $this->filename = $filename;
            } elseif (file_exists($filename)) {
                throw new \InvalidArgumentException("File '$filename' isn't readable.");
            } else {
                throw new \InvalidArgumentException("File '$filename' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($filename). "' for argument 'filename' given."
            );
        }

        return $this;
    }
1306447
protected function safeFileExists($sFilePath)
    {
        if (!is_string($sFilePath)) {
            throw new \InvalidArgumentException('Argument "$sFilePath" expects a string, "' . (is_object($sFilePath) ? get_class($sFilePath) : gettype($sFilePath)) . '" given');
        }

        // Retrieve "open_basedir" restriction
        if ($this->openBaseDirPaths === null) {
            if ($sOpenBaseDir = ini_get('open_basedir')) {
                $this->openBaseDirPaths = explode(PATH_SEPARATOR, $sOpenBaseDir);
            } else {
                $this->openBaseDirPaths = array();
            }
        }

        if (!$this->openBaseDirPaths) {
            return file_exists($sFilePath);
        }
        foreach ($this->openBaseDirPaths as $sAllowedPath) {
            if (strpos($sFilePath, $sAllowedPath)) {
                return file_exists($sFilePath);
            }
        }
        return false;
    }
368916
protected static function checkFileReadableJob(string $path): bool
    {
        if (!\is_file($path) || !\is_readable($path)) {
            return false;
        }
        
        return true;
    }
948331
private function validateLocalFile($path) {
        if (!is_file($path)) {
            throw new InvalidArgumentException('File does not exist: ' . $path);
        }

        if (!filesize($path)) {
            throw new InvalidArgumentException('File is of zero length: ' . $path);
        }
    }
22658
protected function _ensurePathExistence($filePath) {
        $folders = explode(DIRECTORY_SEPARATOR, $filePath);
        // discard the actual file
        array_pop($folders);
        $path = implode(DIRECTORY_SEPARATOR, $folders);
        if (file_exists($path)) {
            return;
        }
        mkdir($path, 0777, true);
    }
1073584
public function isReadable($path)
    {
        $node = $this->at($path);
        return null !== $node && (0x0100 & $node->perms);
    }
813627
private function checkFileTypeIsAllowed()
	{
		if(count($this->allowedMimeTypes) > 0)
		{
			if(! in_array($this->file->getMimeType(), $this->allowedMimeTypes))
			{
				throw new InvalidFileTypeException("Invalid File Type: " . $this->file->getMimeType() . " has not been allowed");
			}
		}
	}
1251161
private boolean validateFilePath(String filePath) {
        if (filePath == null || filePath.isEmpty()) {
            throw new IllegalArgumentException("filePath must be a valid filePath within the file system.");
        }

        // Check if the filename exists as a File -- use an absolute file to ensure we have
        // a parent: even if that parent is ${user.dir} ...
        File loc = new File(filePath).getAbsoluteFile();

        return (loc.exists() || loc.getParentFile().exists());
    }
887922
public function setStdinFile(string $path): Process
    {
        if (!is_readable($path)) {
            throw new \InvalidArgumentException(
                "invalid value provided for 'path'; ".
                "'$path' is not a readable file"
            );
        }
        $this->spec[self::STDIN] = ["file", $path, "r"];
        $this->stdin = "";
        return $this;
    }
509015
protected function isWritable($filePath)
    {
        return !is_dir($filePath)
            &&
            (file_exists($filePath) ? is_writable($filePath) : is_writable(dirname($filePath)));
    }