tarsana /
command
| 1 | <?php namespace Tarsana\Command; |
||
| 2 | |||
| 3 | use Tarsana\Command\Command; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * A SubCommand which has a parent command and can access it. |
||
| 7 | */ |
||
| 8 | class SubCommand extends Command { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * The parent command. |
||
| 12 | * |
||
| 13 | * @var Tarsana\Command\Command |
||
| 14 | */ |
||
| 15 | protected $parent; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Creates a new SubCommand. |
||
| 19 | * |
||
| 20 | * @param Command $parent |
||
| 21 | */ |
||
| 22 | public function __construct(Command $parent) |
||
| 23 | { |
||
| 24 | parent::__construct(); |
||
| 25 | $this->parent($parent) |
||
| 26 | ->console($parent->console()) |
||
| 27 | ->fs($parent->fs) |
||
| 28 | ->templatesLoader($parent->templatesLoader); |
||
| 29 | $this->config = $parent->config; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * parent getter and setter. |
||
| 34 | * |
||
| 35 | * @param Tarsana\Command\Command|null |
||
| 36 | * @return Tarsana\Command\Command |
||
| 37 | */ |
||
| 38 | public function parent(Command $value = null) |
||
| 39 | { |
||
| 40 | if (null === $value) { |
||
| 41 | return $this->parent; |
||
| 42 | } |
||
| 43 | $this->parent = $value; |
||
|
0 ignored issues
–
show
|
|||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 47 | } |
||
| 48 |
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..