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 — 5.0 ( c6890e )
by Jonny
23:29
created

MessageFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace JonnyW\PhantomJs\Http;
11
12
/**
13
 * PHP PhantomJs.
14
 *
15
 * @author Jon Wenmoth <[email protected]>
16
 */
17
class MessageFactory implements MessageFactoryInterface
18
{
19
    /**
20
     * Internal constructor.
21
     */
22
    public function __construct()
23
    {
24
        @trigger_error(__CLASS__.' is deprecated since version 4.6 and will be removed in 5.0.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
25
    }
26
27
    /**
28
     * Get singleton instance.
29
     *
30
     * @return \JonnyW\PhantomJs\Http\MessageFactory
31
     */
32
    public static function getInstance()
33
    {
34
        if (!self::$instance instanceof MessageFactoryInterface) {
35
            self::$instance = new self();
36
        }
37
38
        return self::$instance;
39
    }
40
41
    /**
42
     * Create request instance.
43
     *
44
     * @param string $url
45
     * @param string $method
46
     * @param int    $timeout
47
     *
48
     * @return \JonnyW\PhantomJs\Http\Request
49
     */
50
    public function createRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
51
    {
52
        return new Request($url, $method, $timeout);
53
    }
54
55
    /**
56
     * Create capture request instance.
57
     *
58
     * @param string $url
59
     * @param string $method
60
     * @param int    $timeout
61
     *
62
     * @return \JonnyW\PhantomJs\Http\CaptureRequest
63
     */
64
    public function createCaptureRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
65
    {
66
        return new CaptureRequest($url, $method, $timeout);
67
    }
68
69
    /**
70
     * Create PDF request instance.
71
     *
72
     * @param string $url
73
     * @param string $method
74
     * @param int    $timeout
75
     *
76
     * @return \JonnyW\PhantomJs\Http\PdfRequest
77
     */
78
    public function createPdfRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
79
    {
80
        return new PdfRequest($url, $method, $timeout);
81
    }
82
83
    /**
84
     * Create response instance.
85
     *
86
     * @return \JonnyW\PhantomJs\Http\Response
87
     */
88
    public function createResponse()
89
    {
90
        return new Response();
91
    }
92
}
93