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.
Completed
Push — master ( 9d146b...51e265 )
by Nicholas
03:09
created

DebugRepository::logMethodCall()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace UCD\Infrastructure\Repository\CharacterRepository;
4
5
use Psr\Log\LoggerInterface;
6
7
use UCD\Unicode\Character\Properties\General\Block;
8
use UCD\Unicode\Character\Properties\General\GeneralCategory;
9
use UCD\Unicode\Character\Properties\General\Script;
10
use UCD\Unicode\Codepoint;
11
use UCD\Unicode\Character\Repository;
12
13
class DebugRepository implements Repository
14
{
15
    /**
16
     * @var Repository
17
     */
18
    protected $delegate;
19
20
    /**
21
     * @var LoggerInterface
22
     */
23
    private $logger;
24
25
    /**
26
     * @param Repository $delegate
27
     * @param LoggerInterface $logger
28
     */
29
    public function __construct(Repository $delegate, LoggerInterface $logger)
30
    {
31
        $this->delegate = $delegate;
32
        $this->logger = $logger;
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function getByCodepoint(Codepoint $codepoint)
39
    {
40
        $this->logMethodCall(__FUNCTION__, [$codepoint]);
41
42
        return $this->delegate->getByCodepoint($codepoint);
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     */
48
    public function getByCodepoints(Codepoint\Collection $codepoints)
49
    {
50
        $this->logMethodCall(__FUNCTION__, [$codepoints]);
51
52
        return $this->delegate->getByCodepoints($codepoints);
53
    }
54
55
    /**
56
     * {@inheritDoc}
57
     */
58
    public function getAll()
59
    {
60
        $this->logMethodCall(__FUNCTION__);
61
62
        return $this->delegate->getAll();
63
    }
64
65
    /**
66
     * {@inheritDoc}
67
     */
68
    public function getCodepointsByBlock(Block $block)
69
    {
70
        $this->logMethodCall(__FUNCTION__);
71
72
        return $this->delegate->getCodepointsByBlock($block);
73
    }
74
75
    /**
76
     * {@inheritDoc}
77
     */
78
    public function getCodepointsByCategory(GeneralCategory $category)
79
    {
80
        $this->logMethodCall(__FUNCTION__);
81
82
        return $this->delegate->getCodepointsByCategory($category);
83
    }
84
85
    /**
86
     * {@inheritDoc}
87
     */
88
    public function getCodepointsByScript(Script $script)
89
    {
90
        $this->logMethodCall(__FUNCTION__);
91
92
        return $this->delegate->getCodepointsByScript($script);
93
    }
94
95
    /**
96
     * {@inheritDoc}
97
     */
98
    public function count()
99
    {
100
        $this->logMethodCall(__FUNCTION__);
101
102
        return $this->delegate->count();
103
    }
104
105
    /**
106
     * @param string $method
107
     * @param array $details
108
     */
109
    protected function logMethodCall($method, array $details = [])
110
    {
111
        $message = $this->composeMessageFromMethodDetails($method, $details);
112
        $this->log($message);
113
    }
114
115
    /**
116
     * @param string $method
117
     * @param array $details
118
     * @return string
119
     */
120
    protected function composeMessageFromMethodDetails($method, array $details = [])
121
    {
122
        return sprintf('Repository::%s/%s', $method, json_encode($details));
123
    }
124
125
    /**
126
     * @param string $message
127
     */
128
    protected function log($message)
129
    {
130
        $this->logger->info($message);
131
    }
132
}