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 ( 5ae560...2a5a24 )
by Nicholas
02:59
created

Collection::getSurrogates()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace UCD\Unicode\Character;
4
5
use UCD\Unicode\Character;
6
use UCD\Unicode\Codepoint;
7
use UCD\Unicode\Codepoint\Range;
8
use UCD\Unicode\CodepointAssigned;
9
use UCD\Unicode\Collection\TraversableBackedCollection;
10
use UCD\Unicode\NonCharacter;
11
use UCD\Unicode\Surrogate;
12
13
class Collection extends TraversableBackedCollection
14
{
15
    /**
16
     * @return Codepoint\Collection|Codepoint[]
17
     */
18
    public function extractCodepoints()
19
    {
20
        return new Codepoint\Collection(
21
            $this->yieldCodepoints()
22
        );
23
    }
24
25
    /**
26
     * @return \Generator
27
     */
28
    private function yieldCodepoints()
29
    {
30
        /** @var CodepointAssigned $character */
31
        foreach ($this as $character) {
32
            yield $character->getCodepoint();
33
        }
34
    }
35
36
    /**
37
     * @return static|Character[]
38
     */
39
    public function getCharacters()
40
    {
41
        return $this->filterWith(function (CodepointAssigned $assigned) {
42
            return $assigned instanceof Character;
43
        });
44
    }
45
46
    /**
47
     * @return static|NonCharacter[]
48
     */
49
    public function getNonCharacters()
50
    {
51
        return $this->filterWith(function (CodepointAssigned $assigned) {
52
            return $assigned instanceof NonCharacter;
53
        });
54
    }
55
56
    /**
57
     * @return static|Surrogate[]
58
     */
59
    public function getSurrogates()
60
    {
61
        return $this->filterWith(function (CodepointAssigned $assigned) {
62
            return $assigned instanceof Surrogate;
63
        });
64
    }
65
}