1 | <?php |
||
12 | final class EventStoreBranchSwap extends Command |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * The name and signature of the console command. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $signature = 'smoothphp:swapbranch'; |
||
21 | |||
22 | /** |
||
23 | * The console command description. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $description = 'Command description'; |
||
28 | |||
29 | /** @var Repository */ |
||
30 | private $config; |
||
31 | |||
32 | /** |
||
33 | * Create a new command instance. |
||
34 | * |
||
35 | * @param Repository $config |
||
36 | */ |
||
37 | public function __construct(Repository $config) |
||
42 | |||
43 | /** |
||
44 | * Execute the console command. |
||
45 | * |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function handle() |
||
67 | |||
68 | protected function getGitBranch() |
||
80 | |||
81 | /** |
||
82 | * @param $branch |
||
83 | */ |
||
84 | protected function replaceEnvConfig($branch) |
||
100 | } |
||
101 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.