open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Validator/Constraints/CheckMainAliasPresenceValidator.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused local variables such as '$siteAlias'.
Open

            foreach ($value->getAliases() as $name => $siteAlias) {

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

    public function validate($value, Constraint $constraint)

Class extends undeclared class \Symfony\Component\Validator\ConstraintValidator
Open

class CheckMainAliasPresenceValidator extends ConstraintValidator

Reference to undeclared property \OpenOrchestra\Backoffice\Validator\Constraints\CheckMainAliasPresenceValidator->context
Open

                $this->context->buildViolation($constraint->message)

Catching undeclared class \OpenOrchestra\ModelInterface\Exceptions\MainAliasNotExisting
Open

        } catch (MainAliasNotExisting $exception) {

Parameter $constraint has undeclared type \Symfony\Component\Validator\Constraint
Open

    public function validate($value, Constraint $constraint)

Call to method getMainAlias from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open

            $value->getMainAlias();

Reference to instance property message from undeclared class \Symfony\Component\Validator\Constraint
Open

                $this->context->buildViolation($constraint->message)

Call to method getAliases from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open

            foreach ($value->getAliases() as $name => $siteAlias) {

There are no issues that match your filters.

Category
Status