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.

Socket   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A open() 0 7 1
1
<?php
2
/**
3
 * Pimf
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
9
namespace Pimf\Adapter;
10
11
use Pimf\Contracts\Streamable;
12
13
/**
14
 * Class Socket manages Open Internet or Unix domain socket connection
15
 *
16
 * @package Pimf\Adapter
17
 */
18
class Socket implements Streamable
19
{
20
21
    /**
22
     * If you have compiled in OpenSSL support, you may prefix the hostname with either ssl://
23
     * or tls:// to use an SSL or TLS client connection over TCP/IP to connect to the remote host.
24
     *
25
     * @var string $hostname
26
     */
27
    protected $host;
28
29
    /**
30
     * The port number.
31
     *
32
     * @var int
33
     */
34
    protected $port;
35
36
    /**
37
     * @param $host
38
     * @param $port
39
     */
40
    public function __construct($host, $port)
41
    {
42
        $this->host = $host;
43
        $this->port = $port;
44
    }
45
46
    /**
47
     * @return resource
48
     * @throws \RuntimeException If error on making connection
49
     */
50
    public function open()
51
    {
52
        // system level error number and his error-message.
53
        $error = $message = 0;
54
55
        return fsockopen($this->host, $this->port, $error, $message);
56
    }
57
}
58