Completed
Push — master ( a15ed4...7fb2fc )
by Alexandr
44s
created

Directive::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Date: 3/17/17
4
 *
5
 * @author Volodymyr Rashchepkin <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Directive;
9
10
use Youshido\GraphQL\Config\Directive\DirectiveConfig;
11
use Youshido\GraphQL\Type\Traits\ArgumentsAwareObjectTrait;
12
use Youshido\GraphQL\Type\Traits\AutoNameTrait;
13
14
class Directive implements DirectiveInterface
15
{
16
17
    use ArgumentsAwareObjectTrait;
0 ignored issues
show
Deprecated Code introduced by
The trait Youshido\GraphQL\Type\Tr...gumentsAwareObjectTrait has been deprecated with message: To be removed during the release optimization

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
18
    use AutoNameTrait;
19
20
    protected $isFinal = false;
21
22 3 View Code Duplication
    public function __construct(array $config = [])
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24 3
        if (empty($config['name'])) {
25
            $config['name'] = $this->getName();
26
        }
27
28 3
        $this->config = new DirectiveConfig($config, $this, $this->isFinal);
29 3
        $this->build($this->config);
30 3
    }
31
32 3
    public function build(DirectiveConfig $config)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
35 3
    }
36
37
    public function addArguments($argumentsList)
38
    {
39
        return $this->getConfig()->addArguments($argumentsList);
40
    }
41
42
}
43