private function validatePath(string $path): bool
    {
        if (! $this->fileSystem->has($path)) {
            throw new FileNotFoundException(sprintf('The source file "%s" does not exist.', $path));
        }
        if ($this->fileSystem->get($path)->getType() === 'dir') {
            return false;
        }
        return true;
    }
private function validatePath(string $path): bool
    {
        if (! $this->fileSystem->has($path)) {
            throw new FileNotFoundException(sprintf('The source file "%s" does not exist.', $path));
        }
        if ($this->fileSystem->get($path)->getType() === 'dir') {
            return false;
        }
        return true;
    }
private function validatePath ( string $ path ) : bool { if ( ! $ this -> fileSystem -> has ( $ path ) ) { throw new FileNotFoundException ( sprintf ( 'The source file "%s" does not exist.' , $ path ) ) ; } if ( $ this -> fileSystem -> get ( $ path ) -> getType ( ) === 'dir' ) { return false ; } return true ; }
Validate file has a valid path.

@param string $path The file path.

@return bool True if the path exists and is a file.

@throws FileNotFoundException If the path corresponds to a dir.
Validate file has a valid path .