open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/BusinessRules/Strategies/ContentStrategy.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$parameters'.
Open

    public function canRead(ContentInterface $content, array $parameters)

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

Avoid unused parameters such as '$parameters'.
Open

    public function canDelete(ContentInterface $content, array $parameters)

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

Avoid unused parameters such as '$parameters'.
Open

    public function canDeleteVersion(ContentInterface $content, array $parameters)

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 $content has undeclared type \OpenOrchestra\ModelInterface\Model\ContentInterface
Open

    public function canEdit(ContentInterface $content, array $parameters)

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

    public function canDelete(ContentInterface $content, array $parameters)

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

    public function canDeleteVersion(ContentInterface $content, array $parameters)

Parameter $contentRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface
Open

    public function __construct(

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

        return $this->contentRepository->countNotDeletedByLanguage($content->getContentId(), $content->getLanguage()) > 1 && $this->isContentOnSiteAllowed($content) && !$content->getStatus()->isPublishedState();

Call with 2 arg(s) to \OpenOrchestra\Backoffice\BusinessRules\Strategies\ContentStrategy::isContentOnSiteAllowed() which only takes 1 arg(s) defined at /code/Backoffice/BusinessRules/Strategies/ContentStrategy.php:106
Open

        return $this->isContentOnSiteAllowed($content, $parameters) && !$content->getStatus()->isBlockedEdition();

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

    protected function isContentOnSiteAllowed(ContentInterface $content)

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

        return ContentInterface::ENTITY_TYPE;

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

        return $this->contentRepository->countNotDeletedByLanguage($content->getContentId(), $content->getLanguage()) > 1 && $this->isContentOnSiteAllowed($content) && !$content->getStatus()->isPublishedState();

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

        return $this->isContentOnSiteAllowed($content, $parameters) && !$content->getStatus()->isBlockedEdition();

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

        return $this->isContentOnSiteAllowed($content) && false === $this->contentRepository->hasContentIdWithoutAutoUnpublishToState($content->getContentId());

Call to method hasContentIdWithoutAutoUnpublishToState from undeclared class \OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface
Open

        return $this->isContentOnSiteAllowed($content) && false === $this->contentRepository->hasContentIdWithoutAutoUnpublishToState($content->getContentId());

Parameter $siteRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\SiteRepositoryInterface
Open

    public function __construct(

Call to method countNotDeletedByLanguage from undeclared class \OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface
Open

        return $this->contentRepository->countNotDeletedByLanguage($content->getContentId(), $content->getLanguage()) > 1 && $this->isContentOnSiteAllowed($content) && !$content->getStatus()->isPublishedState();

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

        return $this->contentRepository->countNotDeletedByLanguage($content->getContentId(), $content->getLanguage()) > 1 && $this->isContentOnSiteAllowed($content) && !$content->getStatus()->isPublishedState();

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

    public function canRead(ContentInterface $content, array $parameters)

Call to method findOneBySiteId from undeclared class \OpenOrchestra\ModelInterface\Repository\SiteRepositoryInterface
Open

        $site = $this->siteRepository->findOneBySiteId($siteId);

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

        return in_array($content->getContentType(), $site->getContentTypes());

PHP keywords must be lowercase; expected "const" but found "CONST"
Open

    CONST DELETE_VERSION = 'DELETE_VERSION';

Line exceeds 120 characters; contains 211 characters
Open

        return $this->contentRepository->countNotDeletedByLanguage($content->getContentId(), $content->getLanguage()) > 1 && $this->isContentOnSiteAllowed($content) && !$content->getStatus()->isPublishedState();

Line exceeds 120 characters; contains 160 characters
Open

        return $this->isContentOnSiteAllowed($content) && false === $this->contentRepository->hasContentIdWithoutAutoUnpublishToState($content->getContentId());

There are no issues that match your filters.

Category
Status