| Conditions | 3 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function register(Container $app) |
||
| 14 | { |
||
| 15 | if (!$app->offsetExists('sandstone.push.enabled')) { |
||
| 16 | $app['sandstone.push.enabled'] = true; |
||
| 17 | } |
||
| 18 | |||
| 19 | $app['sandstone.push.event_serializer'] = function () use ($app) { |
||
| 20 | if (!$app->offsetExists('serializer')) { |
||
| 21 | throw new \RuntimeException('A serializer must be registered'); |
||
| 22 | } |
||
| 23 | |||
| 24 | return new EventSerializer($app['serializer']); |
||
| 25 | }; |
||
| 26 | |||
| 27 | $app['sandstone.push.event_forwarder'] = function () use ($app) { |
||
| 28 | return new EventForwarder( |
||
| 29 | $app['sandstone.push'], |
||
| 30 | $app['dispatcher'], |
||
| 31 | $app['sandstone.push.event_serializer'], |
||
| 32 | $app['sandstone.push.enabled'] |
||
| 33 | ); |
||
| 34 | }; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |