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.
Completed
Push — master ( 7e6ebb...3066b8 )
by Dwight
12s
created

InteractsWithConnection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 81.82%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 38
ccs 9
cts 11
cp 0.8182
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A openConnection() 0 12 2
A closeConnection() 0 4 1
1
<?php
2
3
namespace NotificationChannels\Apn;
4
5
use Exception;
6
use NotificationChannels\Apn\Exception\ConnectionFailed;
7
8
trait InteractsWithConnection
9
{
10
    /**
11
     * The connection credentials.
12
     *
13
     * @var \NotificationChannels\Apn\ApnCredentials
14
     */
15
    protected $credentials;
16
17
    /**
18
     * Open the connection to the feedback service.
19
     *
20
     * @return void
21
     * @throws \NotificationChannels\Apn\Exception\ConnectionFailed
22
     */
23 3
    protected function openConnection()
24
    {
25
        try {
26 3
            $this->client->open(
0 ignored issues
show
Bug introduced by
The property client 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...
27 3
                $this->credentials->environment(),
28 3
                $this->credentials->certificate(),
29 3
                $this->credentials->passPhrase()
30
            );
31
        } catch (Exception $exception) {
32
            throw ConnectionFailed::create($exception);
33
        }
34 3
    }
35
36
    /**
37
     * Close the connection.
38
     *
39
     * @return void
40
     */
41 3
    protected function closeConnection()
42
    {
43 3
        $this->client->close();
44 3
    }
45
}
46