PimpleServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace SocketCluster\Providers;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
use SocketCluster\WebSocket;
8
use SocketCluster\SocketCluster;
9
10
class PimpleServiceProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * Register bindings in the container.
14
     *
15
     * @return void
16
     */
17
    public function register(Container $app)
18
    {
19 1
        $app['socketcluster'] = function ($app) {
20 1
            $websocket = WebSocket::factory($app['socketcluster.options']);
21 1
            return new SocketCluster($websocket);
22
        };
23 1
    }
24
}
25