Backoffice/GenerateForm/Strategies/SearchStrategy.php
Avoid unused parameters such as '$options'. Open
Open
public function buildForm(FormBuilderInterface $builder, array $options)
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Call to method findAllSpecialPage
from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open
Open
$specialPages = $this->nodeRepository->findAllSpecialPage($language, $siteId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method add
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->add('value', 'text', array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method add
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->add('limit', 'integer', array(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $nodeRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $block
has undeclared type \OpenOrchestra\ModelInterface\Model\BlockInterface
Open
Open
public function support(BlockInterface $block)
- Create a ticketCreate a ticket
- Exclude checks
Call to method getComponent
from undeclared class \OpenOrchestra\ModelInterface\Model\BlockInterface
Open
Open
return $this->getName() === $block->getComponent();
- Create a ticketCreate a ticket
- Exclude checks
Call to method add
from undeclared class \Symfony\Component\Form\FormBuilderInterface
Open
Open
$builder->add('nodeId', 'choice', array(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $builder
has undeclared type \Symfony\Component\Form\FormBuilderInterface
Open
Open
public function buildForm(FormBuilderInterface $builder, array $options)
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $basicBlockConfiguration. Keep variable name length under 20. Open
Open
array $basicBlockConfiguration
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The closing brace for the class must go on the next line after the body Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
protected function getSpecialPageList() {
- Create a ticketCreate a ticket
- Exclude checks