Showing 162 of 162 total issues
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)
Each class must be in a file by itself Open
class SymfonyRequirements extends RequirementCollection
- Exclude checks
The class AppKernel has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13. Open
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Each class must be in a file by itself Open
class PhpIniRequirement extends Requirement
- Exclude checks
Each class must be in a file by itself Open
class RequirementCollection implements IteratorAggregate
- Exclude checks
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
There must be one blank line after the last USE statement; 2 found; Open
use Symfony\Component\Form\Extension\Core\Type\TextType;
- Exclude checks
Blank line found at start of control structure Open
if ($form->isSubmitted() && $form->isValid()) {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Exclude checks
There must be one blank line after the namespace declaration Open
namespace JdhmApi\Entity;
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
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
Missing class import via use statement (line '17', column '41'). Open
$client->setDateOfBirth(new \DateTime("now"));
- 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 '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
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 '19', column '17'). Open
new JMS\SerializerBundle\JMSSerializerBundle(),
- 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();
}