1 | <?php |
||
24 | class TimestampableSubscriber implements EventSubscriber |
||
25 | { |
||
26 | /** |
||
27 | * @var array Timestampable fields |
||
28 | */ |
||
29 | protected $fields = ['createdAt', 'updatedAt']; |
||
30 | |||
31 | /** |
||
32 | * @var \Doctrine\ORM\Mapping\ClassMetadataInfo |
||
33 | */ |
||
34 | protected $classMetadata; |
||
35 | |||
36 | /** |
||
37 | * Returns subscribed events |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | public function getSubscribedEvents() |
||
45 | |||
46 | /** |
||
47 | * Event triggered during metadata loading |
||
48 | * |
||
49 | * @param LoadClassMetadataEventArgs $eventArgs |
||
50 | */ |
||
51 | public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) |
||
65 | |||
66 | /** |
||
67 | * Adds timestampable lifecycle callbacks to entity |
||
68 | */ |
||
69 | protected function addLifecycleCallbacks() |
||
75 | |||
76 | protected function getLifecycleCallbacks() |
||
83 | |||
84 | /** |
||
85 | * Iterates through fields and adds mapping to them |
||
86 | */ |
||
87 | protected function mapFields() |
||
93 | |||
94 | /** |
||
95 | * Adds mapping to single field |
||
96 | * |
||
97 | * @param string $field |
||
98 | */ |
||
99 | protected function mapField($field) |
||
109 | |||
110 | /** |
||
111 | * Checks whether the class contains such a method |
||
112 | * |
||
113 | * @param \ReflectionClass $class |
||
114 | * @param string $methodName |
||
115 | * |
||
116 | * @return bool |
||
117 | */ |
||
118 | protected function hasMethod(\ReflectionClass $class, $methodName) |
||
122 | } |
||
123 |
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..