It seems like array_merge($this->fields, $fields) of type array is incompatible with the declared type array<integer,object<Art...LMapper\Mapping\Field>> of property $fields.
Our type inference engine has found an assignment to a property that is incompatible
with the declared type of that property.
Either this assignment is in error or the assigned type should be added
to the documentation/type hint for that property..
Loading history...
50
51
return $this;
52
}
53
54
/**
55
* @return string
56
*/
57
public function getModel()
58
{
59
return $this->model;
60
}
61
62
/**
63
* @param string $model
64
* @return $this
65
*/
66
public function setModel($model)
67
{
68
$this->model = $model;
69
70
return $this;
71
}
72
73
/**
74
* @return array
75
*/
76
public function getResolveConfig()
77
{
78
return $this->resolveConfig;
79
}
80
81
/**
82
* @param array $resolveConfig
83
* @return $this
84
*/
85
public function setResolveConfig(array $resolveConfig)
86
{
87
$this->resolveConfig = $resolveConfig;
88
89
return $this;
90
}
91
92
/**
93
* @param array $resolveConfig
94
* @return $this
95
*/
96
public function mergeResolveConfig(array $resolveConfig)
The expression return array('fields' =>... + parent::toMapping(); seems to be an array, but some of its elements' types (array) are incompatible with the return type of the parent method Arthem\GraphQLMapper\Map...AbstractType::toMapping of type array<string,string>.
If you return a value from a function or method, it should be a sub-type of the
type that is given by the parent type f.e. an interface, or abstract method.
This is more formally defined by the
Lizkov substitution principle,
and guarantees that classes that depend on the parent type can use any instance
of a child type interchangably. This principle also belongs to the
SOLID principles
for object oriented design.
Our function my_function expects a Post object, and outputs the author
of the post. The base class Post returns a simple string and outputting a
simple string will work just fine. However, the child class BlogPost which
is a sub-type of Post instead decided to return an object, and is
therefore violating the SOLID principles. If a BlogPost were passed to
my_function, PHP would not complain, but ultimately fail when executing the
strtoupper call in its body.
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..