AbstractExtractorDefinition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 51
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getNext() 0 4 1
A getVariations() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/js-sandbox PHP library.
5
 *
6
 * Copyright (c) 2016-2017 Bogdan Padalko <[email protected]>
7
 *
8
 * Licensed under the MIT license: http://opensource.org/licenses/MIT
9
 *
10
 * For the full copyright and license information, please view the
11
 * LICENSE file that was distributed with this source or visit
12
 * http://opensource.org/licenses/MIT
13
 */
14
15
16
namespace Pinepain\JsSandbox\Extractors\Definition;
17
18
19
abstract class AbstractExtractorDefinition implements ExtractorDefinitionInterface
20
{
21
    /**
22
     * @var null|string
23
     */
24
    private $name;
25
    /**
26
     * @var null|ExtractorDefinitionInterface
27
     */
28
    private $next;
29
    /**
30
     * @var ExtractorDefinitionInterface[]
31
     */
32
    private $variations;
33
34
    /**
35
     * @param null|string                       $name
36
     * @param null|ExtractorDefinitionInterface $next
37
     * @param ExtractorDefinitionInterface[]    $variations
38
     */
39 9
    public function __construct(?string $name, ?ExtractorDefinitionInterface $next, array $variations)
40
    {
41 9
        $this->name       = $name;
42 9
        $this->next       = $next;
43 9
        $this->variations = $variations;
44 9
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 9
    public function getName(): ?string
50
    {
51 9
        return $this->name;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57 9
    public function getNext(): ?ExtractorDefinitionInterface
58
    {
59 9
        return $this->next;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65 9
    public function getVariations(): array
66
    {
67 9
        return $this->variations;
68
    }
69
}
70