It seems like $fieldType defined by \Youshido\GraphQL\Type\T...rTypeObject($fieldType) on line 25 can also be of type object<Youshido\GraphQL\Type\AbstractType>; however, Youshido\GraphQL\Type\Ty...::getScalarTypeObject() does only seem to accept string, 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.
The expression $this->_typeOf; of type Youshido\GraphQL\Type\AbstractType|string adds the type string to the return on line 70 which is incompatible with the return type declared by the interface Youshido\GraphQL\Type\Co...ypeInterface::getTypeOf of type Youshido\GraphQL\Type\AbstractType.
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.