I try to use SublimeLinter-phplint to lint my php files in Sublime Text 3. The linter is ran, but does not follow the 'use' statements, thus it does not understand my inheritance and raises more errors. For example, here's a controller :
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class TestController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function index(Request $request)
{
return response()->json([], 200);
}
}
The first error I get is
ERROR: unknown type `Controller'
followed by
ERROR: unknown method App\Http\Controllers\TestController::middleware
Which clearly shows that phplint is not able to understand the 'use' statement. What are the steps to resolve this ? Is it a configuration issue or is phplint not able to do that ? (I'm using laravel 5)
You should remove
use App\Http\Controllers\Controller;this. This might create problem. The Controller code will be