idea-php-laravel-plugin
idea-php-laravel-plugin copied to clipboard
Update the plugin will be something wrong
When I update the Laravel-Plugins,if you use some static method exm "User::find($id)" will waring to " Non-static method User::find() should not be called statically",this very bad!
`namespace App\Http\Controllers\Web;
use App\Model\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use EasyWeChat\Foundation\Application;
class TestController extends Controller
{
public function __construct(Application $wechat)
{
parent::__construct($wechat);
}
public function index(Request $request)
{
$user = User::find(12);
dd($user);
}
}`
Same issue here 👍
+1
It's caused by changes in Laravel code -- they have added @mixin
tags to few classes which "broke" the IDE (as far as I understand such methods are now treated as non-static only).
ATM you may just disable appropriate inspection in PhpStorm.
Other than that --- it's more suitable to Laravel IDE helper package rather than this plugin: https://github.com/barryvdh/laravel-ide-helper/issues/541#issuecomment-317411918
They all have issues. I have been adding docs to a branch of laravel and trying to keep that up to date. Started with the ide helper and have been adding as I see them.
https://github.com/Artistan/laraframe-docblock/tree/docblock-methods
clone the repo into a directory like ./PackageDev/laraframe-docblock/
check out the docblock-methods branch
add namespace to composer.json so your app uses that instead, with all the docs..
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
],
"psr-4": {
"App\\": "app/",
"Illuminate\\": "PackageDevelopment/laraframe-docblock/src/Illuminate/"
}
},