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 ( 61bf69...3a1917 )
by Nicholas
03:32
created

DebugRepository::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
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\Codepoint;
10
use UCD\Unicode\Character\Repository;
11
use UCD\Unicode\CodepointAssigned;
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 count()
94
    {
95
        $message = $this->composeMessage(__FUNCTION__);
96
        $this->log($message);
97
98
        return $this->delegate->count();
99
    }
100
101
    /**
102
     * @param string $method
103
     * @param array $details
104
     * @return string
105
     */
106
    protected function composeMessage($method, array $details = [])
107
    {
108
        return sprintf('Repository::%s/%s', $method, json_encode($details));
109
    }
110
111
    /**
112
     * @param string $message
113
     */
114
    protected function log($message)
115
    {
116
        $this->logger->info($message);
117
    }
118
}