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.

FileAdapter::isThrowawayDomain()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\Adapter;
13
14
use EmailChecker\Utilities;
15
16
/**
17
 * Throwaway email adapter build with file.
18
 *
19
 * @author Matthieu Moquet <[email protected]>
20
 */
21
class FileAdapter implements AdapterInterface
22
{
23
    protected $domains;
24
25
    /**
26
     * @param string $filename Filename containing all domains
27
     */
28
    public function __construct($filename)
29
    {
30
        if (!file_exists($filename)) {
31
            throw new \InvalidArgumentException(sprintf('File "%s" not found', $filename));
32
        }
33
34
        $this->domains = Utilities::parseLines(file_get_contents($filename));
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function isThrowawayDomain($domain)
41
    {
42
        return in_array($domain, $this->domains);
43
    }
44
}
45