public function normalizeFile(string $file, int $options = self::MODE_DEFAULT): string
    {
        $file = \str_replace('\\', '/', $file);
        if (false === \strrpos($file, '/')) {
            $mess = 'An empty path is NOT allowed';
            throw new \DomainException($mess);
        }
        [$fileName, $path] = \explode('/', \strrev($file), 2);
        $path = \strrev($path);
        $fileName = \trim(strrev($fileName));
        if ('' === $fileName) {
            $mess = 'An empty file name is NOT allowed';
            throw new \DomainException($mess);
        }
        if (!\ctype_print($fileName)) {
            $mess = 'Using any non-printable characters in the file name is NOT allowed';
            throw new \DomainException($mess);
        }
        return $this->normalizePath($path, $options) . $fileName;
    }
public function normalizeFile(string $file, int $options = self::MODE_DEFAULT): string
    {
        $file = \str_replace('\\', '/', $file);
        if (false === \strrpos($file, '/')) {
            $mess = 'An empty path is NOT allowed';
            throw new \DomainException($mess);
        }
        [$fileName, $path] = \explode('/', \strrev($file), 2);
        $path = \strrev($path);
        $fileName = \trim(strrev($fileName));
        if ('' === $fileName) {
            $mess = 'An empty file name is NOT allowed';
            throw new \DomainException($mess);
        }
        if (!\ctype_print($fileName)) {
            $mess = 'Using any non-printable characters in the file name is NOT allowed';
            throw new \DomainException($mess);
        }
        return $this->normalizePath($path, $options) . $fileName;
    }
public function normalizeFile ( string $ file , int $ options = self :: MODE_DEFAULT ) : string { $ file = \ str_replace ( '\\' , '/' , $ file ) ; if ( false === \ strrpos ( $ file , '/' ) ) { $ mess = 'An empty path is NOT allowed' ; throw new \ DomainException ( $ mess ) ; } [ $ fileName , $ path ] = \ explode ( '/' , \ strrev ( $ file ) , 2 ) ; $ path = \ strrev ( $ path ) ; $ fileName = \ trim ( strrev ( $ fileName ) ) ; if ( '' === $ fileName ) { $ mess = 'An empty file name is NOT allowed' ; throw new \ DomainException ( $ mess ) ; } if ( ! \ ctype_print ( $ fileName ) ) { $ mess = 'Using any non-printable characters in the file name is NOT allowed' ; throw new \ DomainException ( $ mess ) ; } return $ this -> normalizePath ( $ path , $ options ) . $ fileName ; }
Used to normalize a file with a path.

Note MUST include an actual file name and NOT just a path. Use
normalizePath() for checking paths without file names.

@param string $file      File with a path.
@param int    $options   Determines the options FPN uses while
validating path.

@return string Returns the file name with a normalized path.
@throws \DomainException
@throws \LogicException
@since 0.2.0-dev Added to making using class easier.
@uses  FilePathNormalizer::normalizePath() to normalize path part.
@api
Used to normalize a file with a path .