GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

UuidServiceProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Germania\UuidServiceProvider;
3
4
use Ramsey\Uuid\Uuid;
5
6
use Pimple\Container;
7
use Pimple\ServiceProviderInterface;
8
9
class UuidServiceProvider implements ServiceProviderInterface
10
{
11
12
    public $config = array();
13
14 25
    public function __construct( array $config = array() )
15
    {
16 25
        $this->config = array_merge($this->config, $config);
17 25
    }
18
19
20
    /**
21
     * @implements ServiceProviderInterface
22
     */
23 20
    public function register(Container $dic)
24
    {
25
26
        /**
27
         * @return array
28
         */
29 1
        $dic['UUID.config'] = function( $dic ) {
0 ignored issues
show
Unused Code introduced by
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30 5
            return $this->config;
31
        };
32
33
        /**
34
         * @return Ramsey\Uuid\Uuid
35
         */
36 5
        $dic['UUID.new'] = $dic->factory(function( $dic ) {
0 ignored issues
show
Unused Code introduced by
The parameter $dic is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37 20
            return Uuid::uuid4();
38 25
        });
39
40
        /**
41
         * @return string
42
         */
43 5
        $dic['UUID.new.hex'] = $dic->factory(function( $dic ) {
44 10
            return $dic['UUID.new']->getHex();
45 25
        });
46
47
48
        /**
49
         * @return Callable
50
         */
51 5
        $dic['UUID.Factory'] = $dic->protect(function() use ($dic) {
52 5
            return $dic['UUID.new'];
53 25
        });
54
55
        /**
56
         * @return Callable
57
         */
58 10
        $dic['UUID.HexFactory'] = $dic->protect(function() use ($dic) {
59 5
            return $dic['UUID.new.hex'];
60 25
        });
61
62
63 25
    }
64
}
65