| Conditions | 2 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function register(Container $app) |
||
| 17 | { |
||
| 18 | $app['sandstone.push'] = function () use ($app) { |
||
| 19 | $pushServerHost = $app['sandstone.push.server']['host']; |
||
| 20 | $pushServerPort = $app['sandstone.push.server']['port']; |
||
| 21 | |||
| 22 | $context = new ZMQContext(); |
||
| 23 | $socket = $context->getSocket(ZMQ::SOCKET_PUSH); |
||
| 24 | $socket->connect("tcp://$pushServerHost:$pushServerPort"); |
||
| 25 | |||
| 26 | $pushServer = new ZMQPushServer($socket); |
||
|
|
|||
| 27 | |||
| 28 | if ($app['debug']) { |
||
| 29 | $pushServer = new TraceablePushServer($pushServer); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $pushServer; |
||
| 33 | }; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: