Running against a relatively small Laravel 5.7 app:
$ php artisan insights
96/126 [鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒鈻戔枒鈻戔枒鈻戔枒] 76%
In EmptyCommentSniff.php line 153:
Return value of SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::getCommentContent() must be of the type string, boolean returned
Same reproduced on laravel 5.8. with a small app:
56/60 [鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻戔枒] 93%
Symfony\Component\Debug\Exception\FatalThrowableError : Return value of SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::getCommentContent() must be of the type string, boolean returned
It's possible to have the source code of your apps? Is open source? Otherwise I can't debug this.
Another option is: Try to understand what is the piece of code where the bug happens, so I can reproduce it locally.
Just before the error: $commentEndPointer is -1
at that point the file is routes/api.php with this content:
`
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
/*
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
*/`
IF i run again with removed comment:
`
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
`
everything works fine.
I hope this helps a little :-)
Have the same issue. Looks like empty comments that don't have a description are the problem. While @akosglue can find the root of his problem, I can't.
Same issue here. :/
The issue happens when you have non closed docs.
As @akosglue already mentioned, this problem appears when the middleware in routes/api.php is commented as shown in screenshoots. After fixing this, there's another error #59
This issue has been fixed on the version v1.8.1.