app/Extension/Twig/SecurityPolicy.php
Missing class import via use statement (line '39', column '14'). Open
Open
return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid unused private fields such as '$allowedFunctions'. Open
Open
private $allowedFunctions = ['YFParser'];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private fields such as '$allowedFilters'. Open
Open
private $allowedFilters = ['escape', 'lower', 'upper', 'date', 'split'];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private fields such as '$allowedProperties'. Open
Open
private $allowedProperties = [];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private fields such as '$allowedTags'. Open
Open
private $allowedTags = ['if', 'for', 'set'];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Avoid unused private fields such as '$allowedMethods'. Open
Open
private $allowedMethods = [];
- Read upRead up
- Exclude checks
UnusedPrivateField
Since: 0.2
Detects when a private field is declared and/or assigned a value, but not used.
Example
class Something
{
private static $FOO = 2; // Unused
private $i = 5; // Unused
private $j = 6;
public function addOne()
{
return $this->j++;
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield
Call to method __construct
from undeclared class \Twig\Sandbox\SecurityPolicy
Open
Open
return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
- Exclude checks
Return type of getPolicy()
is undeclared type \Twig\Sandbox\SecurityPolicy
Open
Open
public static function getPolicy(): \Twig\Sandbox\SecurityPolicy
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private $allowedMethods = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private $allowedTags = ['if', 'for', 'set'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Allowed properties */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private $allowedFilters = ['escape', 'lower', 'upper', 'date', 'split'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return \Twig\Sandbox\SecurityPolicy
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Allowed methods */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Allowed functions */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private $allowedFunctions = ['YFParser'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$instance = new self();
- Exclude checks
Line exceeds 120 characters; contains 185 characters Open
Open
return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
private $allowedProperties = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function getPolicy(): \Twig\Sandbox\SecurityPolicy
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Allowed filters */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Gets the sandbox security policy.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Allowed tags */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return new \Twig\Sandbox\SecurityPolicy($instance->allowedTags, $instance->allowedFilters, $instance->allowedMethods, $instance->allowedProperties, $instance->allowedFunctions);
- Exclude checks