phptools code like
$paypal = app(PayPal::class);
needs the app()
function to be annotated so the editor will understand its return type.
There are several ways of doing so, but I guess the app()
function is from Laravel package so you cannot change it.
- using generics:
/**
* @template TName
* @param class-string<TName> $abstract
* @return TName
*/
function app($abstract = null, array $parameters = []) {
- or using the (usually generated)
.phpstorm.meta.php
\app(0), map([
'' => '@',
]);