Backoffice/Form/Type/Component/NodeChoiceType.php
Avoid unused parameters such as '$form'. Open
Open
public function buildView(FormView $view, FormInterface $form ,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
Class extends undeclared class \Symfony\Component\Form\AbstractType
Open
Open
class NodeChoiceType extends AbstractType
- Create a ticketCreate a ticket
- Exclude checks
Call to method setDefaults
from undeclared class \Symfony\Component\OptionsResolver\OptionsResolver
Open
Open
$resolver->setDefaults(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $resolver
has undeclared type \Symfony\Component\OptionsResolver\OptionsResolver
Open
Open
public function configureOptions(OptionsResolver $resolver)
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property vars
from undeclared class \Symfony\Component\Form\FormView
Open
Open
$view->vars['choices'] = $result;
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ROOT_NODE_ID
from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
Open
$orderedNodes = $this->nodeRepository->findTreeNode($siteId, $language, NodeInterface::ROOT_NODE_ID);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \Symfony\Component\Form\ChoiceList\View\ChoiceView
Open
Open
$result[] = new ChoiceView(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $form
has undeclared type \Symfony\Component\Form\FormInterface
Open
Open
public function buildView(FormView $view, FormInterface $form ,array $options)
- Create a ticketCreate a ticket
- Exclude checks
Call to method findTreeNode
from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open
Open
$orderedNodes = $this->nodeRepository->findTreeNode($siteId, $language, NodeInterface::ROOT_NODE_ID);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $options
has undeclared type \Symfony\Component\OptionsResolver\Options
Open
Open
'choices' => function(Options $options) {
- Create a ticketCreate a ticket
- Exclude checks
Parameter $nodeRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open
Open
public function __construct(NodeRepositoryInterface $nodeRepository, ContextBackOfficeInterface $currentSiteManager)
- Create a ticketCreate a ticket
- Exclude checks
Suspicious array access to \Symfony\Component\OptionsResolver\Options
Open
Open
return $this->getChoices($options['siteId'], $options['language']);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $view
has undeclared type \Symfony\Component\Form\FormView
Open
Open
public function buildView(FormView $view, FormInterface $form ,array $options)
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ROOT_NODE_ID
from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
Open
$orderedNodes = $this->nodeRepository->findTreeNode($options['siteId'], $options['language'], NodeInterface::ROOT_NODE_ID);
- Create a ticketCreate a ticket
- Exclude checks
Call to method findTreeNode
from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open
Open
$orderedNodes = $this->nodeRepository->findTreeNode($options['siteId'], $options['language'], NodeInterface::ROOT_NODE_ID);
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property vars
from undeclared class \Symfony\Component\Form\FormView
Open
Open
foreach ($view->vars['choices'] as $node) {
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $orderedNodesAttributs. Keep variable name length under 20. Open
Open
$orderedNodesAttributs = $this->getHierarchicalChoicesAttributes($orderedNodes);
- 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
Expected 0 spaces between argument "$form" and comma; 1 found Open
Open
public function buildView(FormView $view, FormInterface $form ,array $options)
- Create a ticketCreate a ticket
- Exclude checks
Expected 1 space between comma and type hint "array"; 0 found Open
Open
public function buildView(FormView $view, FormInterface $form ,array $options)
- Create a ticketCreate a ticket
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
Open
'choices' => function(Options $options) {
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
Open
$orderedNodes = $this->nodeRepository->findTreeNode($options['siteId'], $options['language'], NodeInterface::ROOT_NODE_ID);
- Create a ticketCreate a ticket
- Exclude checks