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 ( 0edef5...fd3de2 )
by Nicholas
03:23
created

DebugRepository::getCodepointsByScript()   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.4285
cc 1
eloc 4
nc 1
nop 1
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
        $message = $this->composeMessage(__FUNCTION__, [$codepoint]);
41
        $this->log($message);
42
43
        return $this->delegate->getByCodepoint($codepoint);
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    public function getByCodepoints(Codepoint\Collection $codepoints)
50
    {
51
        $message = $this->composeMessage(__FUNCTION__, [$codepoints]);
52
        $this->log($message);
53
54
        return $this->delegate->getByCodepoints($codepoints);
55
    }
56
57
    /**
58
     * {@inheritDoc}
59
     */
60
    public function getAll()
61
    {
62
        $message = $this->composeMessage(__FUNCTION__);
63
        $this->log($message);
64
65
        return $this->delegate->getAll();
66
    }
67
68
    /**
69
     * {@inheritDoc}
70
     */
71
    public function getCodepointsByBlock(Block $block)
72
    {
73
        $message = $this->composeMessage(__FUNCTION__);
74
        $this->log($message);
75
76
        return $this->delegate->getCodepointsByBlock($block);
77
    }
78
79
    /**
80
     * {@inheritDoc}
81
     */
82
    public function getCodepointsByCategory(GeneralCategory $category)
83
    {
84
        $message = $this->composeMessage(__FUNCTION__);
85
        $this->log($message);
86
87
        return $this->delegate->getCodepointsByCategory($category);
88
    }
89
90
    /**
91
     * {@inheritDoc}
92
     */
93
    public function getCodepointsByScript(Script $script)
94
    {
95
        $message = $this->composeMessage(__FUNCTION__);
96
        $this->log($message);
97
98
        return $this->delegate->getCodepointsByScript($script);
99
    }
100
101
    /**
102
     * {@inheritDoc}
103
     */
104
    public function count()
105
    {
106
        $message = $this->composeMessage(__FUNCTION__);
107
        $this->log($message);
108
109
        return $this->delegate->count();
110
    }
111
112
    /**
113
     * @param string $method
114
     * @param array $details
115
     * @return string
116
     */
117
    protected function composeMessage($method, array $details = [])
118
    {
119
        return sprintf('Repository::%s/%s', $method, json_encode($details));
120
    }
121
122
    /**
123
     * @param string $message
124
     */
125
    protected function log($message)
126
    {
127
        $this->logger->info($message);
128
    }
129
}