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 ( c89fd6...8a8538 )
by Matthieu
47:31 queued 44:14
created

ThrowawayDomains::getIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the EmailChecker package.
5
 *
6
 * (c) Matthieu Moquet <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace EmailChecker;
13
14
/**
15
 * List of built-in throwaway domains read from the resources folder.
16
 *
17
 * @author Matthieu Moquet <[email protected]>
18
 */
19
class ThrowawayDomains implements \IteratorAggregate, \Countable
20
{
21
    public function __construct()
22
    {
23
        $this->domains = Utilities::parseLines(file_get_contents(
0 ignored issues
show
Bug introduced by
The property domains does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
24
            __DIR__.'/../../res/throwaway_domains.txt'
25
        ));
26
    }
27
28
    public function toArray()
29
    {
30
        return $this->domains;
31
    }
32
33
    public function getIterator()
34
    {
35
        return new \ArrayIterator($this->toArray());
36
    }
37
38
    public function count()
39
    {
40
        return count($this->domains);
41
    }
42
}
43