alt3 / cakephp-swagger

Swagger plugin for documenting your CakePHP APIs
MIT License
64 stars 17 forks source link

$swaggerOptions should be an empty array, not null #31

Closed aceat64 closed 7 years ago

aceat64 commented 7 years ago

With version 2.0.8 of zircote/swagger-php, the following warnings are being generated:

Warning (2): array_key_exists() expects parameter 2 to be array, null given [ROOT/vendor/zircote/swagger-php/src/functions.php, line 33]
Warning (2): array_key_exists() expects parameter 2 to be array, null given [ROOT/vendor/zircote/swagger-php/src/functions.php, line 34]
Warning (2): array_key_exists() expects parameter 2 to be array, null given [ROOT/vendor/zircote/swagger-php/src/functions.php, line 35]
Warning (2): array_key_exists() expects parameter 2 to be array, null given [ROOT/vendor/zircote/swagger-php/src/functions.php, line 36]

This is because swagger-php is no longer supressing warnings when settings $options for Swagger\scan().

The fix is really simple, we just need to set $swaggerOptions to an empty array instead of null. I have tested this against 2.0.7 and 2.0.8 of swagger-php.

codecov-io commented 7 years ago

Current coverage is 100% (diff: 100%)

No coverage report found for master at 4f1eaec.

Powered by Codecov. Last update 4f1eaec...7d00ddb

bravo-kernel commented 7 years ago

Thank you kindly, created a new release 1.0.3 👍