PublicSuffixList::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 2
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * PHP Domain Parser: Public Suffix List based URL parsing.
7
 *
8
 * @link      http://github.com/jeremykendall/php-domain-parser for the canonical source repository
9
 *
10
 * @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
11
 * @license   http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
12
 */
13
14
namespace Pdp;
15
16
/**
17
 * Public Suffix List.
18
 */
19
class PublicSuffixList extends \ArrayObject
20
{
21
  /**
22
   * Public constructor.
23
   *
24
   * @param mixed $list Array representing Public Suffix List or PHP Public Suffix List file
25
   */
26 15
  public function __construct($list)
27
  {
28 15
    if (!\is_array($list)) {
29
      /** @noinspection PhpIncludeInspection */
30 15
      $list = require $list;
31
    }
32
33 15
    parent::__construct($list);
34 15
  }
35
}
36