1 | <?php |
||
38 | final class SingleCommand implements DomainCommandInterface |
||
39 | { |
||
40 | use HasTargetTrait; |
||
41 | use HasOptionsTrait; |
||
42 | use HasVersionRepositoryTrait; |
||
43 | |||
44 | /** @var CollectionContextInterface */ |
||
45 | private $context; |
||
46 | |||
47 | /** |
||
48 | * CollectionCommand constructor. |
||
49 | * |
||
50 | * @param DeltaInterface $target |
||
51 | * @param OptionsInterface $options |
||
52 | * @param VersionRepositoryInterface $versionRepository |
||
53 | * @param CollectionContextInterface $context |
||
|
|||
54 | */ |
||
55 | 2 | public function __construct( |
|
56 | DeltaInterface $target, |
||
57 | OptionsInterface $options, |
||
58 | VersionRepositoryInterface $versionRepository, |
||
59 | CollectionContextInterface $context = null |
||
60 | ) { |
||
61 | 2 | if (null === $context) { |
|
62 | 2 | $context = new CollectionContext(new Progress(1, 1)); |
|
63 | 2 | } |
|
64 | |||
65 | 2 | $this->context = $context; |
|
66 | 2 | $this->setTarget($target); |
|
67 | 2 | $this->setOptions($options); |
|
68 | 2 | $this->setVersionRepository($versionRepository); |
|
69 | 2 | } |
|
70 | |||
71 | /** |
||
72 | * @return CollectionContextInterface |
||
73 | */ |
||
74 | 2 | public function getContext() |
|
78 | } |
||
79 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.