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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 24
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A isThrowawayDomain() 0 4 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