src/Sandbox.php
Suspicious type null
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Open
$form .= '<br />' . $this->action[2]
- Exclude checks
Returning type object
but getClass()
is declared to return bool
Open
Open
return new $this->class($this->logger);
- Exclude checks
Invalid offset 2
of array type array{}
Open
Open
$form .= '<br />' . $this->action[2]
- Exclude checks
Argument 1 (object)
is bool
but \get_class()
takes object
Open
Open
$this->logger->debug('SANDBOX: class: '.get_class($class));
- Exclude checks
Invalid offset 2
of array type array{}
Open
Open
if (isset($this->action[2]) && $this->action[2]) { // Requires argument
- Exclude checks
Call to method format
on non-class type string
Open
Open
$response = $class->format($results);
- Exclude checks
Invalid offset 3
of array type array{}
Open
Open
if (isset($this->action[3]) && $this->action[3]) { // Requires Identifier
- Exclude checks
Suspicious type void
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Open
$response = '<pre>' . var_dump($results) . '</pre>';
- Exclude checks
Cannot assign void return value Open
Open
$response = var_dump($results);
- Exclude checks
The 'getClass()' method which returns a boolean should be named 'is...()' or 'has...()' Open
Open
protected function getClass()
{
$classNames = array_unique(array_column($this->methods, '0'));
if (!in_array($this->class, $classNames)) {
$this->logger->critical('getClass: Class Denied:', [$this->class]);
- Read upRead up
- Exclude checks
BooleanGetMethodName
Since: 0.2
Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.
Example
class Foo {
/**
* @return boolean
*/
public function getFoo() {} // bad
/**
* @return bool
*/
public function isFoo(); // ok
/**
* @return boolean
*/
public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}