idea-php-laravel-plugin icon indicating copy to clipboard operation
idea-php-laravel-plugin copied to clipboard

Update the plugin will be something wrong

Open vlongen opened this issue 7 years ago • 6 comments

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!

vlongen avatar Aug 03 '17 05:08 vlongen

`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);
	}
}`

vlongen avatar Aug 03 '17 05:08 vlongen

Same issue here 👍

TorbenL avatar Aug 10 '17 12:08 TorbenL

image

TorbenL avatar Aug 10 '17 12:08 TorbenL

+1

abdelAudace avatar Sep 12 '17 07:09 abdelAudace

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

bazzik avatar Sep 18 '17 21:09 bazzik

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/"
    }
  },

Artistan avatar Nov 29 '17 17:11 Artistan