Method __construct
has 300 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
File SymfonyRequirements.php
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of the Symfony package.
*
Function __construct
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
{
$cfgValue = ini_get($cfgName);
if (is_callable($evaluation)) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
Method addPhpIniRequirement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
Method addPhpIniRecommendation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
The method __construct() has 366 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Exclude checks
The method __construct() has an NPath complexity of 737280. The configured NPath complexity threshold is 200. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method __construct() has a Cyclomatic Complexity of 37. The configured cyclomatic complexity threshold is 10. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method __construct() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
{
$cfgValue = ini_get($cfgName);
if (is_callable($evaluation)) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Remove error control operator '@' on line 445. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '557', column '26'). Open
$r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
- 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
Missing class import via use statement (line '666', column '34'). Open
$reflector = new ReflectionExtension('intl');
- 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
The method __construct has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '203', column '24'). Open
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
- 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
Missing class import via use statement (line '252', column '24'). Open
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
- 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
Missing class import via use statement (line '234', column '24'). Open
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
- 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
The method addPhpIniRequirement has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation. Open
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Remove error control operator '@' on line 446. Open
public function __construct()
{
/* mandatory requirements follow */
$installedPhpVersion = phpversion();
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '137', column '27'). Open
throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
- 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
The method __construct has a boolean flag argument $optional, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '657', column '30'). Open
null !== new Collator('fr_FR'),
- 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
The method addPhpIniRecommendation has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation. Open
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '180', column '20'). Open
return new ArrayIterator($this->requirements);
- 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
The method __construct has a boolean flag argument $optional, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '216', column '24'). Open
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
- 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 using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'. Open
sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'. Open
sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (null === $testMessage) {
$testMessage = sprintf('%s %s be %s in php.ini',
$cfgName,
$optional ? 'should' : 'must',
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'PDO' in method '__construct'. Open
$drivers = PDO::getAvailableDrivers();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'. Open
\Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->addRequirement(
version_compare(phpversion('apc'), '3.0.17', '>='),
'APC version must be at least 3.0.17',
'Upgrade your <strong>APC</strong> extension (3.0.17+).'
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$reflector = new ReflectionExtension('intl');
ob_start();
$reflector->info();
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'. Open
\Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'DateTimeZone' in method '__construct'. Open
foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Requirement
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class SymfonyRequirements extends RequirementCollection
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class RequirementCollection implements IteratorAggregate
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class PhpIniRequirement extends Requirement
- Exclude checks
Avoid variables with short names like $r. Configured minimum length is 3. Open
$r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Each class must be in a file by itself Open
class SymfonyRequirements extends RequirementCollection
- Exclude checks
Each class must be in a file by itself Open
class RequirementCollection implements IteratorAggregate
- Exclude checks
Each class must be in a file by itself Open
class PhpIniRequirement extends Requirement
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'xdebug.show_exception_trace', false, true
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'xdebug.scream', false, true
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'date.timezone', true, false,
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'xdebug.scream', false, true
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
$installedPhpVersion, self::REQUIRED_PHP_VERSION),
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'xdebug.show_exception_trace', false, true
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
'date.timezone', true, false,
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
- Exclude checks
Line exceeds 120 characters; contains 230 characters Open
'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '.
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
- Exclude checks
Line exceeds 120 characters; contains 280 characters Open
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
- Exclude checks
Line exceeds 120 characters; contains 162 characters Open
'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.'
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
* @param bool $optional Whether this is only an optional recommendation not a mandatory requirement
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
'Set "<strong>mbstring.func_overload</strong>" to <strong>0</strong> in php.ini<a href="#phpini">*</a> to disable function overloading by the mbstring extension.'
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
(version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
- Exclude checks
Line exceeds 120 characters; contains 228 characters Open
sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
- Exclude checks
Line exceeds 120 characters; contains 209 characters Open
'<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
- Exclude checks
Line exceeds 120 characters; contains 248 characters Open
'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
'Set "<strong>realpath_cache_size</strong>" to e.g. "<strong>1024</strong>" in php.ini<a href="#phpini">*</a> to improve performance on windows.'
- Exclude checks
Line exceeds 120 characters; contains 264 characters Open
'In most cases you should be fine, but please verify there is no inconsistencies between data provided by Symfony and the intl extension. See https://github.com/symfony/symfony/issues/15007 for an example of inconsistencies you might run into.'
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
'Set "<strong>intl.error_level</strong>" to "<strong>0</strong>" in php.ini<a href="#phpini">*</a> to inhibit the messages when an error occurs in ICU functions.'
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
$installedPhpVersion, self::REQUIRED_PHP_VERSION),
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$testMessage = sprintf('%s %s be %s in php.ini',
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
- Exclude checks
Opening parenthesis of a multi-line function call must be the last content on the line Open
$helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
- Exclude checks
Closing parenthesis of a multi-line function call must be on a line by itself Open
$installedPhpVersion, self::REQUIRED_PHP_VERSION),
- Exclude checks