Backoffice/Validator/Constraints/CheckMainAliasPresenceValidator.php
Avoid unused local variables such as '$siteAlias'. Open
Open
foreach ($value->getAliases() as $name => $siteAlias) {
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Parameter $value
has undeclared type \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
public function validate($value, Constraint $constraint)
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \Symfony\Component\Validator\ConstraintValidator
Open
Open
class CheckMainAliasPresenceValidator extends ConstraintValidator
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\Backoffice\Validator\Constraints\CheckMainAliasPresenceValidator->context
Open
Open
$this->context->buildViolation($constraint->message)
- Create a ticketCreate a ticket
- Exclude checks
Catching undeclared class \OpenOrchestra\ModelInterface\Exceptions\MainAliasNotExisting
Open
Open
} catch (MainAliasNotExisting $exception) {
- Create a ticketCreate a ticket
- Exclude checks
Parameter $constraint
has undeclared type \Symfony\Component\Validator\Constraint
Open
Open
public function validate($value, Constraint $constraint)
- Create a ticketCreate a ticket
- Exclude checks
Call to method getMainAlias
from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
$value->getMainAlias();
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property message
from undeclared class \Symfony\Component\Validator\Constraint
Open
Open
$this->context->buildViolation($constraint->message)
- Create a ticketCreate a ticket
- Exclude checks
Call to method getAliases
from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
foreach ($value->getAliases() as $name => $siteAlias) {
- Create a ticketCreate a ticket
- Exclude checks