src/Traits/PathTrait.php
private static function myHandleFilenamePart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?string &$filename = null, ?string &$error = null): bool
    {
        if (!$partValidator($part, false, $error)) {
            return false;
        }

        if ($stringDecoder !== null) {
            $part = $stringDecoder($part);
        }

        $filename = $part;

        return true;
    }
private static function myHandleFilenamePart(string $part, callable $partValidator, ?callable $stringDecoder = null, ?string &$filename = null, ?string &$error = null): bool
    {
        if (!$partValidator($part, false, $error)) {
            return false;
        }

        if ($stringDecoder !== null) {
            $part = $stringDecoder($part);
        }

        $filename = $part;

        return true;
    }
private static function myHandleFilenamePart ( string $ part , callable $ partValidator , ? callable $ stringDecoder = null , ? string & $ filename = null , ? string & $ error = null ) : bool { if ( ! $ partValidator ( $ part , false , $ error ) ) { return false ; } if ( $ stringDecoder !== null ) { $ part = $ stringDecoder ( $ part ) ; } $ filename = $ part ; return true ; }
Handles the file name part.

@param string        $part          The file name part.
@param callable      $partValidator The part validator.
@param callable|null $stringDecoder The string decoding function or null if parts should not be decoded.
@param string|null   $filename      The file if parsing was not successful, undefined otherwise.
@param string|null   $error         The error text if validation was not successful, undefined otherwise.

@return bool True if parsing was successful, false otherwise.
Handles the file name part .