1 | <?php |
||
13 | class MagerunCommandTester |
||
14 | { |
||
15 | /** |
||
16 | * @var TestCase |
||
17 | */ |
||
18 | private $testCase; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $commandName; |
||
24 | |||
25 | /** |
||
26 | * @see CommandTester::execute() |
||
27 | * @var array of command input |
||
28 | */ |
||
29 | private $input; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $status; |
||
35 | |||
36 | /** |
||
37 | * @var CommandTester |
||
38 | */ |
||
39 | private $commandTester; |
||
40 | |||
41 | /** |
||
42 | * MagerunCommandTester constructor. |
||
43 | * |
||
44 | * @param TestCase $testCase |
||
45 | * @param string|array $input |
||
46 | */ |
||
47 | public function __construct(TestCase $testCase, array $input) |
||
56 | |||
57 | /** |
||
58 | * @return Command |
||
59 | */ |
||
60 | public function getCommand() |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getDisplay() |
||
74 | |||
75 | /** |
||
76 | * @return int |
||
77 | */ |
||
78 | public function getStatus() |
||
84 | |||
85 | private function getExecutedCommandTester() |
||
94 | |||
95 | /** |
||
96 | * @return CommandTester |
||
97 | */ |
||
98 | private function getCommandTester() |
||
110 | |||
111 | /** |
||
112 | * @return Command |
||
113 | */ |
||
114 | private function getCommandInternal() |
||
134 | } |
||
135 |
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: