【发布时间】:2019-12-03 06:48:08
【问题描述】:
我正在使用 php 版本 7.2,但现在升级到 7.4 在生成 l5-swagger 时出现问题。 我读了这个stackoverflow qauestion,它对我不起作用。
php artisan l5-swagger:generate
Regenerating docs
ErrorException : Trying to access array offset on value of type bool
at /home/smartmobe/Projects/defence-new/server/vendor/zircote/swagger-php/src/StaticAnalyser.php:37
33| if (empty($GLOBALS['swagger_opcache_warning'])) {
34| $GLOBALS['swagger_opcache_warning'] = true;
35| $status = opcache_get_status();
36| $config = opcache_get_configuration();
> 37| if ($status['opcache_enabled'] && $config['directives']['opcache.save_comments'] == false) {
38| Logger::warning("php.ini \"opcache.save_comments = 0\" interferes with extracting annotations.\n[LINK] http://php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments");
39| }
40| }
41| }
Exception trace:
1 Illuminate\Foundation\Bootstrap\HandleExceptions::handleError()
/home/smartmobe/Projects/defence-new/server/vendor/zircote/swagger-php/src/StaticAnalyser.php:37
2 Swagger\StaticAnalyser::fromFile()
/home/smartmobe/Projects/defence-new/server/vendor/zircote/swagger-php/src/functions.php:41
Please use the argument -v to see more details.
【问题讨论】:
-
你能检查一下 zircote/swagger-php 是否有版本 >= 3.0.3?
-
我当前的 zircote/swagger-php 版本是 2.0.14。
标签: php swagger laravel-6 swagger-php php-7.4