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 ( 0e9349...d2bdfd )
by Nicolas
08:54 queued 04:10
created

symphony/content/content.ajaxfilters.php (3 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * @package content
4
 */
5
/**
6
 * The AjaxSections page return an object of all sections and their fields
7
 * that are available for pre-population
8
 */
9
10
class contentAjaxFilters extends JSONPage
11
{
12
    public function view()
13
    {
14
        $handle = General::sanitize($_GET['handle']);
15
        $section = General::sanitize($_GET['section']);
16
        $options = array();
17
        $filters = array();
18
19
        if (!empty($handle) && !empty($section)) {
20
            $section_id = SectionManager::fetchIDFromHandle($section);
21
            $field_id = FieldManager::fetchFieldIDFromElementName($handle, $section_id);
22
            $field = FieldManager::fetch($field_id);
23
24 View Code Duplication
            if (!empty($field) && $field->canPublishFilter() === true) {
0 ignored issues
show
The method canPublishFilter cannot be called on $field (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
25
                if (method_exists($field, 'getToggleStates')) {
26
                    $options = $field->getToggleStates();
0 ignored issues
show
The method getToggleStates cannot be called on $field (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
27
                } elseif (method_exists($field, 'findAllTags')) {
28
                    $options = $field->findAllTags();
0 ignored issues
show
The method findAllTags cannot be called on $field (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
29
                }
30
            }
31
        }
32
33
        foreach ($options as $value => $data) {
34
            $filters[] = array(
35
                'value' => ($value ? $value : $data),
36
                'text' => ($data ? $data : $value)
37
            );
38
        }
39
40
        $this->_Result['filters'] = $filters;
41
    }
42
}
43