open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Security/Authorization/Voter/ContentVoter.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$action'.
Open

    protected function voteForOwnedSubject($action, $content, TokenInterface $token)

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

Parameter $token has undeclared type \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

    protected function voteForReadAction($subject, TokenInterface $token)

Parameter $token has undeclared type \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

    protected function voteForOwnedSubject($action, $content, TokenInterface $token)

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

            && $this->isSubjectInPerimeter($content->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Call to method getContentType from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

            $contentType = $subject->getContentType();

Parameter $subject has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    protected function voteForReadAction($subject, TokenInterface $token)

Parameter $content has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    protected function voteForOwnedSubject($action, $content, TokenInterface $token)

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

        return $this->isSubjectInPerimeter($contentType, $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Call to method getUser from undeclared class \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

            && $this->isSubjectInPerimeter($subject->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Parameter $subject has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    protected function voteForSomeoneElseSubject($action, $subject, TokenInterface $token)

Call to method getUser from undeclared class \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

        return $this->isSubjectInPerimeter($contentType, $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Call to method getContentType from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

            && $this->isSubjectInPerimeter($subject->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Call to method getUser from undeclared class \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

            && $this->isSubjectInPerimeter($content->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open

            && $this->isSubjectInPerimeter($subject->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Reference to constant ENTITY_TYPE from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

        return $subject === ContentInterface::ENTITY_TYPE;

Parameter $token has undeclared type \Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Open

    protected function voteForSomeoneElseSubject($action, $subject, TokenInterface $token)

Call to method getContentType from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

            && $this->isSubjectInPerimeter($content->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Terminating statement must be indented to the same level as the CASE body
Open

            break;

Terminating statement must be indented to the same level as the CASE body
Open

            break;

Line exceeds 120 characters; contains 125 characters
Open

            && $this->isSubjectInPerimeter($content->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

Line exceeds 120 characters; contains 125 characters
Open

            && $this->isSubjectInPerimeter($subject->getContentType(), $token->getUser(), ContentTypeInterface::ENTITY_TYPE);

There are no issues that match your filters.

Category
Status