private static function myDriveValidator(string $drive, ?string &$error): bool
    {
        if (!preg_match('/^[a-zA-Z]$/', $drive)) {
            $error = 'Drive "' . $drive . '" is invalid.';

            return false;
        }

        return true;
    }
private static function myDriveValidator(string $drive, ?string &$error): bool
    {
        if (!preg_match('/^[a-zA-Z]$/', $drive)) {
            $error = 'Drive "' . $drive . '" is invalid.';

            return false;
        }

        return true;
    }
private static function myDriveValidator ( string $ drive , ? string & $ error ) : bool { if ( ! preg_match ( '/^[a-zA-Z]$/' , $ drive ) ) { $ error = 'Drive "' . $ drive . '" is invalid.' ; return false ; } return true ; }
Validates a drive.

@param string      $drive The drive to validate.
@param string|null $error The error text if validation was not successful, undefined otherwise.

@return bool True if validation was successful, false otherwise.
Validates a drive .