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 (104)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/ZfTable/Params/AdapterArrayObject.php (5 issues)

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
 * ZfTable ( Module for Zend Framework 2)
4
 *
5
 * @copyright Copyright (c) 2013 Piotr Duda [email protected]
6
 * @license   MIT License
7
 */
8
9
namespace ZfTable\Params;
10
11
use ZfTable\Params\AbstractAdapter;
12
use ZfTable\Params\AdapterInterface;
13
use ZfTable\Table\Exception;
14
15
class AdapterArrayObject extends AbstractAdapter implements AdapterInterface, \Zend\Stdlib\InitializableInterface
16
{
17
18
    /**
19
     *
20
     * @var \ArrayObject | \Zend\Stdlib\ArrayObject
21
     */
22
    protected $object;
23
24
    /**
25
     *
26
     * @var int
27
     */
28
    protected $page;
29
30
    /**
31
     *
32
     * @var string
33
     */
34
    protected $order;
35
36
    /**
37
     *
38
     * @var string
39
     */
40
    protected $column;
41
42
    /**
43
     *
44
     * @var int
45
     */
46
    protected $itemCountPerPage;
47
48
    /**
49
     * Quick search
50
     * @var string
51
     */
52
    protected $quickSearch;
53
54
55
     /**
56
     * Array of filters
57
     * @var array
58
     */
59
    protected $filters;
60
61
    const DEFAULT_PAGE = 1;
62
    const DEFAULT_ORDER = 'asc';
63
    const DEFAULT_ITEM_COUNT_PER_PAGE = 2;
64
65
66 View Code Duplication
    public function __construct($object)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
67
    {
68
        if ($object instanceof \ArrayObject) {
69
            $this->object = $object;
70
        } elseif ($object instanceof \Zend\Stdlib\ArrayObject) {
0 ignored issues
show
The class Zend\Stdlib\ArrayObject does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
71
            $this->object = $object;
0 ignored issues
show
Documentation Bug introduced by
It seems like $object of type object<Zend\Stdlib\ArrayObject> is incompatible with the declared type object<ArrayObject> of property $object.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
72
        } else {
73
            throw new Exception\InvalidArgumentException('parameter must be instance of ArrayObject');
74
        }
75
    }
76
77
    /**
78
     * Init method
79
     */
80
    public function init()
81
    {
82
        $array = (method_exists($this->object, 'toArray')) ? $this->object->toArray() : $this->object->getArrayCopy();
83
84
        $this->page = (isset($array['zfTablePage'])) ? $array['zfTablePage'] : self::DEFAULT_PAGE;
85
        $this->column = (isset($array['zfTableColumn'])) ? $array['zfTableColumn'] : null;
86
        $this->order = (isset($array['zfTableOrder'])) ? $array['zfTableOrder'] : self::DEFAULT_ORDER;
87
        $this->itemCountPerPage = (isset($array['zfTableItemPerPage']))
88
            ? $array['zfTableItemPerPage'] : $this->getOptions()->getItemCountPerPage();
89
        $this->quickSearch = (isset($array['zfTableQuickSearch'])) ? $array['zfTableQuickSearch'] : '';
90
91
        //Init filters value
92
        if ($this->getTable()->getOptions('showColumnFilters')) {
0 ignored issues
show
The call to AbstractTable::getOptions() has too many arguments starting with 'showColumnFilters'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
93
            foreach ($array as $key => $value) {
94
                if (substr($key, 0, 4) == 'zff_') {
95
                    $this->filters[$key] = $value;
96
                }
97
            }
98
        }
99
    }
100
101
    public function getPureValueOfFilter($key)
102
    {
103
        return $this->object[$key];
104
    }
105
106
    public function getValueOfFilter($key, $prefix = 'zff_')
107
    {
108
        return $this->filters[$prefix . $key];
109
    }
110
111
    /**
112
     * Get page
113
     *
114
     * @return int
115
     */
116
    public function getPage()
117
    {
118
        return $this->page;
119
    }
120
121
    /**
122
     * Set page
123
     *
124
     * @param string $page
125
     * @return $this
126
     */
127
    public function setPage($page)
128
    {
129
        $this->page = $page;
0 ignored issues
show
Documentation Bug introduced by
The property $page was declared of type integer, but $page is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
130
        return $this;
131
    }
132
133
    /**
134
     * Get order
135
     *
136
     * @return string
137
     */
138
    public function getOrder()
139
    {
140
        return $this->order;
141
    }
142
143
    /**
144
     * Set asc or desc ordering
145
     *
146
     * @param $order
147
     */
148
    public function setOrder($order)
149
    {
150
        $this->order = $order;
151
    }
152
153
    /**
154
     * Get column
155
     *
156
     * @return string
157
     */
158
    public function getColumn()
159
    {
160
        return ($this->column == '') ? null : $this->column;
161
    }
162
163
    /**
164
     *
165
     * @param string $column
166
     * @return $this
167
     */
168
    public function setColumn($column)
169
    {
170
        $this->column = $column;
171
        return $this;
172
    }
173
174
    /**
175
     * Get item count per page
176
     *
177
     * @return int
178
     */
179
    public function getItemCountPerPage()
180
    {
181
        return $this->itemCountPerPage;
182
    }
183
184
    /**
185
     *
186
     * @param int $itemCountPerPage
187
     */
188
    public function setItemCountPerPage($itemCountPerPage)
189
    {
190
        $this->itemCountPerPage = $itemCountPerPage;
191
    }
192
193
    /**
194
     * Return offset
195
     *
196
     * @return int
197
     */
198
    public function getOffset()
199
    {
200
        return ($this->getPage() * $this->getItemCountPerPage()) - $this->getItemCountPerPage();
201
    }
202
203
    /**
204
     * Get quick search string
205
     *
206
     * @return string
207
     */
208
    public function getQuickSearch()
209
    {
210
        return $this->quickSearch;
211
    }
212
}
213