1 | <?php |
||
35 | class MigrationEvent extends AbstractDomainEvent |
||
36 | { |
||
37 | /** @var OptionsInterface */ |
||
38 | private $options; |
||
39 | |||
40 | /** @var DeltaInterface */ |
||
41 | private $target; |
||
42 | |||
43 | /** @var CollectionContextInterface */ |
||
44 | private $context; |
||
45 | |||
46 | /** |
||
47 | * MigrationEvent constructor. |
||
48 | * |
||
49 | * @param DeltaInterface $target |
||
50 | * @param OptionsInterface $options |
||
51 | * @param CollectionContextInterface $context |
||
|
|||
52 | * @param DateTime $occurredOn |
||
53 | */ |
||
54 | 19 | public function __construct( |
|
55 | DeltaInterface $target, |
||
56 | OptionsInterface $options, |
||
57 | CollectionContextInterface $context = null, |
||
58 | DateTime $occurredOn = null |
||
59 | ) { |
||
60 | 19 | if (null === $context) { |
|
61 | 1 | $context = new CollectionContext(new Progress(1, 1)); |
|
62 | 1 | } |
|
63 | 19 | $this->context = $context; |
|
64 | |||
65 | 19 | $this->options = $options; |
|
66 | 19 | $this->target = $target; |
|
67 | |||
68 | 19 | parent::__construct($occurredOn); |
|
69 | 19 | } |
|
70 | |||
71 | /** |
||
72 | * @return OptionsInterface |
||
73 | */ |
||
74 | 2 | public function getOptions() |
|
78 | |||
79 | /** |
||
80 | * Returns the Delta that's being migrated. |
||
81 | * |
||
82 | * NOTE: Do not confuse this method with version() |
||
83 | * |
||
84 | * @return DeltaInterface |
||
85 | */ |
||
86 | 4 | public function getTarget() |
|
90 | |||
91 | /** |
||
92 | * @return CollectionContextInterface |
||
93 | */ |
||
94 | 15 | public function getContext() |
|
98 | |||
99 | /** |
||
100 | * @inheritdoc |
||
101 | */ |
||
102 | 1 | protected function getAdditionalPayload() |
|
110 | } |
||
111 |
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.