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.

Issues (3647)

symphony/lib/toolkit/class.jsonpage.php (4 issues)

1
<?php
2
/**
3
 * @package toolkit
4
 */
5
/**
6
 * JSONPage extends the Page class to provide an object representation
7
 * of a Symphony backend JSON page.
8
 */
9
10
abstract class JSONPage extends TextPage
11
{
12
    /**
13
     * The root node for the response of the JSONPage
14
     * @var array
15
     */
16
    protected $_Result;
17
18
    /**
19
     * The constructor for `JSONPage`. This sets the page status to `Page::HTTP_STATUS_OK`,
20
     * the default content type to `application/json` and initialises `$this->_Result`
21
     * with an `array`. The constructor also starts the Profiler for this
22
     * page template.
23
     *
24
     * @see toolkit.Profiler
25
     */
26
    public function __construct()
27
    {
28
        $this->_Result = array();
29
30
        $this->setHttpStatus(self::HTTP_STATUS_OK);
31
        $this->addHeaderToPage('Content-Type', 'application/json');
32
33
        Symphony::Profiler()->sample('Page template created', PROFILE_LAP);
0 ignored issues
show
The constant PROFILE_LAP was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
34
    }
35
36
    /**
37
     * This function is called by Administration class when a user is not authenticated
38
     * to the Symphony backend. It sets the status of this page to
39
     * `Page::HTTP_STATUS_UNAUTHORIZED` and appends a message for generation
40
     */
41
    public function handleFailedAuthorisation()
42
    {
43
        $this->setHttpStatus(self::HTTP_STATUS_UNAUTHORIZED);
44
        $this->_Result = array('status' => __('You are not authorised to access this page.'));
45
    }
46
47
    /**
48
     * The generate functions outputs the correct headers for
49
     * this `JSONPage`, adds `$this->getHttpStatusCode()` code to the root attribute
50
     * before calling the parent generate function and generating
51
     * the `$this->_Result` json string
52
     *
53
     * @param null $page
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $page is correct as it would always require null to be passed?
Loading history...
54
     * @return string
55
     */
56
    public function generate($page = null)
0 ignored issues
show
Incorrect spacing between argument "$page" and equals sign; expected 0 but found 1
Loading history...
Incorrect spacing between default value and equals sign for argument "$page"; expected 0 but found 1
Loading history...
57
    {
58
        // Set the actual status code in the xml response
59
        $this->_Result['status'] = $this->getHttpStatusCode();
60
61
        parent::generate($page);
62
63
        return json_encode($this->_Result);
64
    }
65
}
66