raml-php-parser icon indicating copy to clipboard operation
raml-php-parser copied to clipboard

ApiDefinition: Fix Deprecated warning on empty schema

Open adriendupuis opened this issue 2 years ago • 0 comments

According to line 815, empty schema is supported. This update avoids passing null when $this->baseUri doesn't have a scheme/schema from \parse_url($this->baseUri, PHP_URL_SCHEME) to mb_strtoupper.

To reproduce:

  • Don't set a baseUri in your RAML configuration ($this->baseUri is null).
  • Set a baseUri without schema, like baseUri: //api.example.com/{version}.

Fix 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

adriendupuis avatar Oct 17 '23 14:10 adriendupuis