I created library like
class Person
{
private $name;
public function __construct($name, $surname)
{
$this->name = $name.' '.$surname;
}
public static function make($name, $surname)
{
return new static($name, $surname);
}
public function get()
{
return $this->name;
}
}
And then i create facades class for it, add in service provider and add alias in config/app.php. it auto complete with first 'make' but the second 'get' method don't auto complete.
Person::make('Yuom', 'Theara')->...;// don't auto complete
why, please help me.
Did you add the phpdocs to your class?
/**
* Make a person
*
* @return static
* @static
*/
public static function make($name, $surname)
{
return new static($name, $surname);
}
I don't add. Does phpdoc relation with ide helper?
The ide-helper generates a file based on the phpdocs from the core laravel classes. So yes, it uses phpdocs. But it doesn't do anything with your own classes, that is just plain autocomplete from phpStorm or whatever you are using. If you want to have autocompletion, provide correct phpdocs.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community