VariadicParameterSpec   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 16
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDefaultValue() 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\Specs\Parameters;
17
18
19
use Pinepain\JsSandbox\Extractors\Definition\ExtractorDefinitionInterface;
20
use Pinepain\JsSandbox\Specs\SpecException;
21
22
23
class VariadicParameterSpec extends AbstractParameterSpec
24
{
25
    /**
26
     * @param string                       $name
27
     * @param ExtractorDefinitionInterface $extractor
28
     */
29 1
    public function __construct(string $name, ExtractorDefinitionInterface $extractor)
30
    {
31 1
        parent::__construct($name, $extractor, true);
32 1
    }
33
34
    public function getDefaultValue()
35
    {
36
        throw new SpecException('Variadic parameter cannot have a default value');
37
    }
38
}
39