Completed
Push — master ( fb9892...6dff17 )
by David
02:46
created

ProviderResponse::getTag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * Copyright (C) 2013 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Model\Tag;
11
12
use Mailgun\Model\ApiResponse;
13
14
/**
15
 * @author Tobias Nyholm <[email protected]>
16
 */
17 View Code Duplication
final class ProviderResponse implements ApiResponse
0 ignored issues
show
Duplication introduced by
This class 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...
18
{
19
    /**
20
     * @var array [name => data[]]
21
     */
22
    private $providers;
23
24
    /**
25
     * @var string
26
     */
27
    private $tag;
28
29
    /**
30
     * @param string $message
0 ignored issues
show
Bug introduced by
There is no parameter named $message. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
31
     */
32 1
    private function __construct()
33
    {
34 1
    }
35
36
    /**
37
     * @param array $data
38
     */
39 1
    public static function create(array $data): self
40
    {
41 1
        $model = new self();
42 1
        $model->tag = $data['tag'] ?? '';
43 1
        $model->providers = $data['providers'] ?? [];
44
45 1
        return $model;
46
    }
47
48 1
    public function getProviders(): array
49
    {
50 1
        return $this->providers;
51
    }
52
53 1
    public function getTag(): string
54
    {
55 1
        return $this->tag;
56
    }
57
}
58