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 ( 0baec8...65564e )
by Jonny
04:04
created

MessageFactory::createPdfRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 3
crap 1
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
namespace JonnyW\PhantomJs\Http;
10
11
/**
12
 * PHP PhantomJs
13
 *
14
 * @author Jon Wenmoth <[email protected]>
15
 */
16
class MessageFactory implements MessageFactoryInterface
17
{
18
    /**
19
     * Client instance
20
     *
21
     * @var \JonnyW\PhantomJs\Http\MessageFactory
22
     * @access private
23
     */
24
    private static $instance;
25
26
    /**
27
     * Get singleton instance.
28
     *
29
     * @access public
30
     * @return \JonnyW\PhantomJs\Http\MessageFactory
31
     */
32 1
    public static function getInstance()
33
    {
34 1
        if (!self::$instance instanceof MessageFactoryInterface) {
35 1
            self::$instance = new MessageFactory();
36 1
        }
37
38 1
        return self::$instance;
39
    }
40
41
    /**
42
     * Create request instance.
43
     *
44
     * @access public
45
     * @param  string                         $url
46
     * @param  string                         $method
47
     * @param  int                            $timeout
48
     * @return \JonnyW\PhantomJs\Http\Request
49
     */
50 23
    public function createRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
51
    {
52 23
        return new Request($url, $method, $timeout);
53
    }
54
55
    /**
56
     * Create capture request instance.
57
     *
58
     * @access public
59
     * @param  string                                $url
60
     * @param  string                                $method
61
     * @param  int                                   $timeout
62
     * @return \JonnyW\PhantomJs\Http\CaptureRequest
63
     */
64 11
    public function createCaptureRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
65
    {
66 11
        return new CaptureRequest($url, $method, $timeout);
67
    }
68
69
    /**
70
     * Create PDF request instance.
71
     *
72
     * @access public
73
     * @param  string                            $url
74
     * @param  string                            $method
75
     * @param  int                               $timeout
76
     * @return \JonnyW\PhantomJs\Http\PdfRequest
77
     */
78 6
    public function createPdfRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000)
79
    {
80 6
        return new PdfRequest($url, $method, $timeout);
81
    }
82
83
    /**
84
     * Create response instance.
85
     *
86
     * @access public
87
     * @return \JonnyW\PhantomJs\Http\Response
88
     */
89 33
    public function createResponse()
90
    {
91 33
        return new Response();
92
    }
93
}
94