I'm using phpstorm 8.0.3 (build 12 February) to build a Laravel 4.2 application. I'm also using the _ide_helper by Barry Heuvel.
I get an error when declaring a method with the same name as an Eloquent method. To be more clear, here is some example code:
class SomeModel extends Eloquent{}
class OtherClass {
public function update($first, $second, $third){
//do some stuff
return true;
}
public function check(){
$item = SomeModel::findOrFail('1');
$item->update([
'name' => 'my name',
'attribute' => 'some attribute'
]);
return "here's the problem!";
}
}
In this code item->update([...
gets highlighted red with the error message Required Parameter $second missing... and if i use "go to declaration" on that piece of code instead of going to the declaration of the update method of Eloquent it goes to the the one declared on top.
Is anyone else getting this error? Have you found a fix? I'm not sure if its a problem of PhpStorm, my code or the ide_helper...
Thanks!
EDIT
I think I found the origin of the problem thanks to the comment by LazyOne.
In the declaration of findOrFail the PHPDoc reads: @return \Illuminate\Support\Collection|static
. When changed to `@return \Illuminate\Support\Collection\static' or simply without the static, the error isn't shown. Is PHPStorm nor reading the docstring properly or is the format incorrect?