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   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 56
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A register() 0 41 1
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