Backoffice/EventSubscriber/UpdateEmbeddedStatusSubscriber.php
Missing class import via use statement (line '24', column '27'). Open
Open
throw new \InvalidArgumentException('Repository should be an instance of StatusableContainerRepositoryInterface');
- Read upRead up
- Create a ticketCreate a ticket
- 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
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Repository\StatusableContainerRepositoryInterface
Open
Open
if (! $statusableRepository instanceof StatusableContainerRepositoryInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Parameter $event
has undeclared type \OpenOrchestra\ModelInterface\Event\StatusEvent
Open
Open
public function updateEmbeddedStatus(StatusEvent $event)
- Create a ticketCreate a ticket
- Exclude checks
Class implements undeclared interface \Symfony\Component\EventDispatcher\EventSubscriberInterface
Open
Open
class UpdateEmbeddedStatusSubscriber implements EventSubscriberInterface
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant STATUS_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\StatusEvents
Open
Open
StatusEvents::STATUS_UPDATE => 'updateEmbeddedStatus',
- Create a ticketCreate a ticket
- Exclude checks
Call to method getStatus
from undeclared class \OpenOrchestra\ModelInterface\Event\StatusEvent
Open
Open
$status = $event->getStatus();
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $statusableRepositories. Keep variable name length under 20. Open
Open
public function __construct(array $statusableRepositories)
- 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 $statusableRepositories. Keep variable name length under 20. Open
Open
protected $statusableRepositories;
- 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
Line exceeds 120 characters; contains 130 characters Open
Open
throw new \InvalidArgumentException('Repository should be an instance of StatusableContainerRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks