我正在使用 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.