1 | <?php |
||
19 | class DebugCommand extends Command |
||
20 | { |
||
21 | /** @var Output */ |
||
22 | protected $output; |
||
23 | |||
24 | /** |
||
25 | * @var TaskCollection |
||
26 | */ |
||
27 | private $tasks; |
||
28 | |||
29 | /** |
||
30 | * @var Deployer |
||
31 | */ |
||
32 | private $deployer; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $tree; |
||
38 | |||
39 | /** |
||
40 | * Depth of nesting (for rendering purposes) |
||
41 | * @var int |
||
42 | */ |
||
43 | private $depth = 0; |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | private $openGroupDepths = []; |
||
49 | |||
50 | /** |
||
51 | * @param Deployer $deployer |
||
52 | */ |
||
53 | 14 | public function __construct(Deployer $deployer) |
|
60 | |||
61 | /** |
||
62 | * Configures the command |
||
63 | */ |
||
64 | 14 | protected function configure() |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | protected function execute(Input $input, Output $output) |
||
85 | |||
86 | /** |
||
87 | * Build the tree based on the given taskName |
||
88 | * @param $taskName |
||
89 | * |
||
90 | * @return void |
||
91 | */ |
||
92 | private function buildTree($taskName) |
||
97 | |||
98 | /** |
||
99 | * Create a tree from the given taskname |
||
100 | * |
||
101 | * @param string $taskName |
||
102 | * @param string $postfix |
||
103 | * @param bool $isLast |
||
104 | * |
||
105 | * @return void |
||
106 | */ |
||
107 | private function createTreeFromTaskName($taskName, $postfix = '', $isLast = false) |
||
153 | |||
154 | /** |
||
155 | * Add the (formatted) taskName to the rendertree, with some additional information |
||
156 | * |
||
157 | * @param string $taskName formatted with prefixes if needed |
||
158 | * @param bool $isLast indication for what symbol to use for rendering |
||
159 | */ |
||
160 | private function addTaskToTree($taskName, $isLast = false) |
||
169 | |||
170 | /** |
||
171 | * Render the tree, after everything is build |
||
172 | * |
||
173 | * @param $taskName |
||
174 | */ |
||
175 | private function outputTree($taskName) |
||
204 | } |
||
205 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.