From bbfd115cda396d42ec0e90d7240bb45b1318335a Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:53:09 +0200 Subject: [PATCH] ApiDefinition: Fix Deprecated warning on empty schema According to line 815, empty schema is supported. "PHP Deprecated: mb_strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/adriendupuis/www/developer-documentation/tools/raml2html/vendor/raml-org/raml-php-parser/src/ApiDefinition.php on line 813" --- src/ApiDefinition.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiDefinition.php b/src/ApiDefinition.php index a9e3c8f..72dfbc8 100644 --- a/src/ApiDefinition.php +++ b/src/ApiDefinition.php @@ -810,7 +810,7 @@ private function getMethodsAsArray(array $resources) private function setProtocolsFromBaseUri(): void { - $schema = \mb_strtoupper(\parse_url($this->baseUri, PHP_URL_SCHEME)); + $schema = \mb_strtoupper(\parse_url($this->baseUri, PHP_URL_SCHEME) ?? ''); $this->protocols = empty($schema) ? [self::PROTOCOL_HTTPS, self::PROTOCOL_HTTP] : [$schema]; }