| 1 | <?php |
||
| 20 | class Method extends Field |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected $args; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $name |
||
| 29 | * @param array $args |
||
| 30 | */ |
||
| 31 | public function __construct($name, array $args = array()) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return $this |
||
| 40 | */ |
||
| 41 | public function with() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | public function args() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | public function apply($value) |
||
| 78 | } |
||
| 79 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: