1 | <?php |
||
49 | class Mediator extends AbstractContainerMediator implements MediatorInterface |
||
50 | { |
||
51 | /** |
||
52 | * @param ContainerInterface|null $serviceContainer |
||
53 | * |
||
54 | * @throws \InvalidArgumentException |
||
55 | * @throws \RuntimeException |
||
56 | */ |
||
57 | public function __construct(ContainerInterface $serviceContainer = null) |
||
61 | /** |
||
62 | * This is used to bring in the service container that will be used. |
||
63 | * |
||
64 | * Though not required it would be considered best practice for this method |
||
65 | * to create a new instance of the container when given null. Another good |
||
66 | * practice is to call this method from the class constructor to allow |
||
67 | * easier testing. |
||
68 | * |
||
69 | * @param ContainerInterface|null $value |
||
70 | * |
||
71 | * @return ContainerMediatorInterface Fluent interface. |
||
72 | * @throws \InvalidArgumentException |
||
73 | * @throws \RuntimeException |
||
74 | * |
||
75 | * @link http://pimple.sensiolabs.org/ Pimple |
||
76 | */ |
||
77 | public function setServiceContainer($value = null): ContainerMediatorInterface |
||
90 | /** |
||
91 | * @param string $eventName |
||
|
|||
92 | * @param EveApiReadWriteInterface $data |
||
93 | * @param EveApiEventInterface $event |
||
94 | * |
||
95 | * @return EventInterface|EveApiEventInterface |
||
96 | * @throws \DomainException |
||
97 | * @throws \InvalidArgumentException |
||
98 | */ |
||
99 | public function triggerEveApiEvent( |
||
110 | /** @noinspection MoreThanThreeArgumentsInspection */ |
||
111 | /** |
||
112 | * @param string $eventName |
||
113 | * @param mixed $level |
||
114 | * @param string $message |
||
115 | * @param array $context |
||
116 | * @param LogEventInterface $event |
||
117 | * |
||
118 | * @return EventInterface |
||
119 | * @throws \DomainException |
||
120 | * @throws \InvalidArgumentException |
||
121 | */ |
||
122 | public function triggerLogEvent( |
||
137 | /** @noinspection GenericObjectTypeUsageInspection */ |
||
138 | /** |
||
139 | * This method is used any time the mediator need to get the actual instance |
||
140 | * of the class for an event. |
||
141 | * |
||
142 | * Normal will only be called during actual trigger of an event since lazy |
||
143 | * loading is used. |
||
144 | * |
||
145 | * @param string $serviceName |
||
146 | * |
||
147 | * @return object |
||
148 | * @throws \LogicException |
||
149 | */ |
||
150 | public function getServiceByName(string $serviceName) |
||
154 | /** |
||
155 | * Used to get the service container. |
||
156 | * |
||
157 | * @return ContainerInterface|null |
||
158 | */ |
||
159 | private function getServiceContainer() |
||
163 | /** |
||
164 | * Holds the container instance to be used. |
||
165 | * |
||
166 | * @var ContainerInterface|null $serviceContainer |
||
167 | */ |
||
168 | private $serviceContainer; |
||
169 | } |
||
170 |
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.