Completed
Push — master ( 189bb6...0d32b3 )
by Matthew
03:08
created

UuidServiceProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Ps2alerts\Api\ServiceProvider;
4
5
use League\Container\ServiceProvider;
6
use Ramsey\Uuid\Uuid;
7
8
class UuidServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $provides = [
14
        'Ramsey\Uuid\Uuid',
15
    ];
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function register()
21
    {
22
        $this->getContainer()->add('Ramsey\Uuid\Uuid', function () {
23
            $uuid = Uuid::Uuid4();
24
            return $uuid;
25
        });
26
    }
27
}
28