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

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

        $directoryParts[] = $part;

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

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

        $directoryParts[] = $part;

        return true;
    }
private static function myHandleDirectoryPart ( string $ part , callable $ partValidator , ? callable $ stringDecoder = null , ? array & $ directoryParts , ? string & $ error = null ) : bool { if ( ! $ partValidator ( $ part , true , $ error ) ) { return false ; } if ( $ stringDecoder !== null ) { $ part = $ stringDecoder ( $ part ) ; } $ directoryParts [ ] = $ part ; return true ; }
Handles the directory 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 array         $directoryParts The directory parts.
@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 directory part .