Backoffice/EventSubscriber/WebSiteNodeTemplateSubscriber.php
Method onPreSetData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function onPreSetData(FormEvent $event)
{
$form = $event->getForm();
$data = $event->getData();
$disabled = null !== $data->getSiteId();
- Create a ticketCreate a ticket
Parameter $event
has undeclared type \Symfony\Component\Form\FormEvent
Open
Open
public function onPreSetData(FormEvent $event)
- Create a ticketCreate a ticket
- Exclude checks
Class implements undeclared interface \Symfony\Component\EventDispatcher\EventSubscriberInterface
Open
Open
class WebSiteNodeTemplateSubscriber implements EventSubscriberInterface
- Create a ticketCreate a ticket
- Exclude checks
Call to method getData
from undeclared class \Symfony\Component\Form\FormEvent
Open
Open
$data = $event->getData();
- Create a ticketCreate a ticket
- Exclude checks
Saw an @param annotation for templateSetParameters,
but it was not found in the param list of function __construct(\OpenOrchestra\Backoffice\Manager\TemplateManager $templateManager)
Open
Open
* @param array $templateSetParameters
- Create a ticketCreate a ticket
- Exclude checks
Call to method getForm
from undeclared class \Symfony\Component\Form\FormEvent
Open
Open
$form = $event->getForm();
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant PRE_SET_DATA
from undeclared class \Symfony\Component\Form\FormEvents
Open
Open
FormEvents::PRE_SET_DATA => 'onPreSetData',
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $templateSetParameters. Keep variable name length under 20. Open
Open
$templateSetParameters = $this->templateManager->getTemplateSetParameters();
- 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
Avoid excessively long variable names like $templateSetParameters. Keep variable name length under 20. Open
Open
$templateSetParameters = $this->templateManager->getTemplateSetParameters();
- 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++ ) {
}
}
}