I was working on php version 7.2 but now upgrading to 7.4 gave an issue while generating l5-swagger. I read this stackoverflow qauestion which is not working for me.
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.
 
     
     
    
