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

Collection   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 6
c 3
b 0
f 0
lcom 1
cbo 2
dl 0
loc 53
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A extractCodepoints() 0 6 1
A yieldCodepoints() 0 7 2
A onlyCharacters() 0 6 1
A onlyNonCharacters() 0 6 1
A onlySurrogates() 0 6 1
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 onlyCharacters()
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 onlyNonCharacters()
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 onlySurrogates()
60
    {
61
        return $this->filterWith(function (CodepointAssigned $assigned) {
62
            return $assigned instanceof Surrogate;
63
        });
64
    }
65
}