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...9916e2 )
by Jonny
24:09
created

BufferOutput::getFormat()   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
rs 10
c 0
b 0
f 0
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\IO;
11
12
/**
13
 * PHP PhantomJs.
14
 *
15
 * @author Jon Wenmoth <[email protected]>
16
 */
17
class BufferOutput implements OutputInterface
18
{
19
    use \GuzzleHttp\Psr7\MessageTrait;
20
    use \JonnyW\PhantomJs\IO\OutputTrait;
21
22
    /**
23
     * Format.
24
     *
25
     * @var string
26
     */
27
    private $format;
28
29
    /**
30
     * Internal constructor.
31
     *
32
     * @param string $format (default: 'PNG')
33
     *
34
     * @throws \InvalidArgumentException
35
     */
36
    public function __construct($format = 'PNG')
37
    {
38
        $formats = array(
39
            'PNG',
40
            'GIF',
41
            'JPEG',
42
            'PDF',
43
        );
44
45
        if (!in_array(strtoupper($format), $formats)) {
46
            throw new \InvalidArgumentException('Output format must be PNG, GIF, JPEG or PDF');
47
        }
48
49
        $this->format = strtoupper($format);
50
    }
51
    
52
    /**
53
     * Get format.
54
     * 
55
     * @access public
56
     * @return string
57
     */
58
    public function getFormat()
59
    {
60
        return $this->format;
61
    }
62
63
    /**
64
     * Get output type.
65
     *
66
     * @return string
67
     */
68
    public function getType()
69
    {
70
        return 'buffer';
71
    }
72
}
73