It seems like view() can also be of type object<Illuminate\View\View>; however, Collective\Html\HtmlBuilder::__construct() does only seem to accept object<Illuminate\Contracts\View\Factory>, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.
Loading history...
36
});
37
}
38
39
/**
40
* Register the form builder instance.
41
*/
42
protected function registerFormBuilder()
43
{
44
$this->app->singleton('form', function ($app) {
45
$formBuilder = new FormBuilder($app['html'], $app['url'], view(), $app['session.store']->getToken());
It seems like view() can also be of type object<Illuminate\View\View>; however, Collective\Html\FormBuilder::__construct() does only seem to accept object<Illuminate\Contracts\View\Factory>, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.