GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Configurable   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 79.17%

Importance

Changes 0
Metric Value
dl 0
loc 88
ccs 19
cts 24
cp 0.7917
rs 10
c 0
b 0
f 0
wmc 11
lcom 2
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
B setUp() 0 16 6
A nullValues() 0 6 1
A uri() 0 10 2
A key() 0 6 1
A getKey() 0 4 1
1
<?php
2
3
namespace SmsaSDK\Concerns;
4
5
use SmsaSDK\Config;
6
7
trait Configurable
8
{
9
    /**
10
     * setUp
11
     * Set up Smsa Configuration by the given config array
12
     * The array has 'key' and 'uri' as keys to it's values.
13
     *
14
     * @param array|null $config
15
     *
16
     * @return $this
17
     */
18 7
    public function setUp($config = [])
19
    {
20 7
        if (empty($this->getKey())) {
21 5
            $this->passkey = empty($config['key']) ? Config::get('smsa_testing_key') : $config['key'];
0 ignored issues
show
Bug introduced by
The property passkey does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
22 5
        }
23
24 7
        if (empty($this->uri)) {
25 5
            $this->uri = empty($config['uri']) ? Config::get('smsa_uri') : $config['uri'];
0 ignored issues
show
Bug introduced by
The property uri does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
26 5
        }
27
28 7
        if (empty($this->wsdlFilePath)) {
0 ignored issues
show
Bug introduced by
The property wsdlFilePath does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
29 5
            $this->setWsdlFilePath();
0 ignored issues
show
Bug introduced by
It seems like setWsdlFilePath() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
30 5
        }
31
32 7
        return $this;
33
    }
34
35
    /**
36
     * nullValues
37
     * Set the default value of the empty values that shall be sent to SECOM.
38
     *
39
     * @param $value
40
     *
41
     * @return $this
42
     */
43 1
    public function nullValues($value)
44
    {
45 1
        $this->nullValues = $value;
0 ignored issues
show
Bug introduced by
The property nullValues does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
46
47 1
        return $this;
48
    }
49
50
    /**
51
     * uri
52
     * Set the WSDL uri.
53
     *
54
     * @param $uri
55
     *
56
     * @return $this
57
     */
58
    public function uri($uri)
59
    {
60
        if (is_null($uri)) {
61
            return $this->uri;
62
        }
63
64
        $this->uri = $uri;
65
66
        return $this;
67
    }
68
69
    /**
70
     * key
71
     * Set the SMSA Key.
72
     *
73
     * @param $passkey
74
     *
75
     * @return $this
76
     */
77 2
    public function key($passkey)
78
    {
79 2
        $this->passkey = $passkey;
80
81 2
        return $this;
82
    }
83
84
    /**
85
     * getKey
86
     * Get SMSA Key.
87
     *
88
     * @return
89
     */
90 8
    public function getKey()
91
    {
92 8
        return $this->passkey;
93
    }
94
}
95