open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Manager/NodeManager.php

Summary

Maintainability
B
5 hrs
Test Coverage

Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

        NodeRepositoryInterface $nodeRepository,
        SiteRepositoryInterface $siteRepository,
        StatusRepositoryInterface $statusRepository,
        BlockRepositoryInterface  $blockRepository,
        ContextBackOfficeInterface $contextManager,
Severity: Major
Found in Backoffice/Manager/NodeManager.php - About 1 hr to fix

Function duplicateArea has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
    {
        foreach ($node->getAreas() as $areaId => $area) {
            $newArea = clone $area;
            $newNode->setArea($areaId, $newArea);
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method createNewErrorNode has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createNewErrorNode($nodeId, $name, $parentId, $siteId, $language, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 45 mins to fix

Method createRootNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function createRootNode($siteId, $language, $name, $routePattern, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 35 mins to fix

Function reorderNodes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function reorderNodes(array $orderedNodes, NodeInterface $parentNode)
    {
        foreach ($orderedNodes as $position => $nodeId) {
            $nodeVersions = $this->nodeRepository->findByNodeAndSite($nodeId, $parentNode->getSiteId());

Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function deleteBlockInNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteBlockInNode(NodeInterface $node)
    {
        foreach ($node->getAreas() as $area) {
            foreach ($area->getBlocks() as $block) {
                if (!$block->isTransverse()) {
Severity: Minor
Found in Backoffice/Manager/NodeManager.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

The method __construct has 11 parameters. Consider reducing the number of parameters to less than 10.
Open

    public function __construct(
        NodeRepositoryInterface $nodeRepository,
        SiteRepositoryInterface $siteRepository,
        StatusRepositoryInterface $statusRepository,
        BlockRepositoryInterface  $blockRepository,
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

The class NodeManager has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
Open

class NodeManager
{
    protected $statusRepository;
    protected $blockRepository;
    protected $eventDispatcher;
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '308', column '21').
Open

        $date = new \DateTime("now");
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

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

The method duplicateArea has a boolean flag argument $duplicateBlock, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method initializeNode uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $node->setNodeId(NodeInterface::ROOT_NODE_ID);
        }
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method duplicateArea uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        $newArea->addBlock($block);
                    }
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Parameter $statusRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findOneByInitial from undeclared class \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open

        $status = $this->statusRepository->findOneByInitial();
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setVersionName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setVersionName($versionName);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $blockRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\BlockRepositoryInterface
Open

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $tokenStorage has undeclared type \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage
Open

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $nodeRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $originalNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Return type of createNewErrorNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createNewErrorNode($nodeId, $name, $parentId, $siteId, $language, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setNodeId($nodeId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setParentId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setParentId($parentId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant ROOT_NODE_ID from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node = $this->initializeNode(NodeInterface::ROOT_NODE_ID, $language, $siteId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setName($name);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of createNewLanguageNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createNewLanguageNode(NodeInterface $node, $language)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setSeoTitle from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setSeoTitle(null);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setMetaIndex from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setMetaIndex(false);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

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

        $oldNode = $this->nodeRepository->findInLastVersion($nodeId, $node->getLanguage(), $siteId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of createRootNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createRootNode($siteId, $language, $name, $routePattern, $template)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant ROOT_PARENT_ID from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node = $this->initializeNode(NodeInterface::ROOT_PARENT_ID, $language, $siteId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of initializeNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function initializeNode($parentId, $language, $siteId, $order = 0)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant ROOT_NODE_ID from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $node->setNodeId(NodeInterface::ROOT_NODE_ID);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

                $nodeVersion->setParentId($parentNode->getNodeId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setParentId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

                $nodeVersion->setParentId($parentNode->getNodeId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method dispatch from undeclared class \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_MOVE, new NodeEvent($nodeVersion));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant POST_BLOCK_CREATE from undeclared class \OpenOrchestra\ModelInterface\BlockEvents
Open

                        $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($newBlock));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getNodeType from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $nodeType = $parentNode->getNodeType();
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getArea from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            if (! $node->getArea($areaName) instanceof AreaInterface) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of createNewVersionNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setInMenu from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setInMenu(false);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setOrder from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setOrder(-1);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setMetaFollow from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setMetaFollow(false);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findInLastVersion from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open

        $parentNode = $this->nodeRepository->findInLastVersion($parentId, $language, $siteId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\AreaInterface
Open

            if (! $node->getArea($areaName) instanceof AreaInterface) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setOrder from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

                $nodeVersion->setOrder($position);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant NODE_MOVE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_MOVE, new NodeEvent($nodeVersion));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Expected @param annotation for name to be before the @param annotation for parentId
Open

     * @param string $parentId
Severity: Info
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setNodeType from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setNodeType(ReadNodeInterface::TYPE_ERROR);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method dispatch from undeclared class \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

                        $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($newBlock));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setTemplate from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setTemplate($template);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setTemplate from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setTemplate($template);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setSitemapPriority from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setSitemapPriority(null);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of hydrateNodeFromNodeId() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function hydrateNodeFromNodeId(NodeInterface $node, $nodeId)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setSitemapChangefreq from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setSitemapChangefreq(null);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setArea from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $newNode->setArea($areaId, $newArea);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setInFooter from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setInFooter(true);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function initializeAreasNode(NodeInterface $node)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setArea from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

                $node->setArea($areaName, new $this->areaClass());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setVersionName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setVersionName($versionName);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method __construct from undeclared class \OpenOrchestra\ModelInterface\Event\NodeEvent
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_MOVE, new NodeEvent($nodeVersion));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setMetaDescription from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setMetaDescription(null);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function deleteBlockInNode(NodeInterface $node)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getAreas from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        foreach ($node->getAreas() as $area) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        if ($parentNode instanceof NodeInterface) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant TYPE_ERROR from undeclared class \OpenOrchestra\ModelInterface\Model\ReadNodeInterface
Open

        $node->setNodeType(ReadNodeInterface::TYPE_ERROR);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method __construct from undeclared class \OpenOrchestra\ModelInterface\Event\NodeEvent
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_CREATION, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant NODE_ADD_LANGUAGE from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_ADD_LANGUAGE, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of duplicateArea() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method __construct from undeclared class \OpenOrchestra\ModelInterface\Event\BlockEvent
Open

                        $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($newBlock));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $parentNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    protected function moveNodeVersions(array $nodeVersions, NodeInterface $parentNode)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Expected @param annotation for templateManager to be before the @param annotation for nodeClass
Open

     * @param string                     $nodeClass
Severity: Info
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setVersion from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getDocumentManager from undeclared class \OpenOrchestra\ModelInterface\Repository\BlockRepositoryInterface
Open

                    $this->blockRepository->getDocumentManager()->remove($block);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setTemplate from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $node->setTemplate($oldNode->getTemplate());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

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

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method __construct from undeclared class \OpenOrchestra\ModelInterface\Event\BlockEvent
Open

                    $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findInLastVersion from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open

        $oldNode = $this->nodeRepository->findInLastVersion($nodeId, $node->getLanguage(), $siteId);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setRoutePattern from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setRoutePattern($routePattern);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getToken from undeclared class \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage
Open

        $node->setCreatedBy($this->tokenStorage->getToken()->getUser()->getUsername());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getSiteId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $nodeVersions = $this->nodeRepository->findByNodeAndSite($nodeId, $parentNode->getSiteId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $eventDispatcher has undeclared type \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

    public function __construct(
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setStatus from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setStatus($status);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method __construct from undeclared class \OpenOrchestra\ModelInterface\Event\NodeEvent
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_ADD_LANGUAGE, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method dispatch from undeclared class \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_ADD_LANGUAGE, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getAreas from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        foreach ($node->getAreas() as $areaId => $area) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getDocumentManager from undeclared class \OpenOrchestra\ModelInterface\Repository\BlockRepositoryInterface
Open

                        $this->blockRepository->getDocumentManager()->persist($newBlock);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of setVersionName() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function setVersionName(NodeInterface $node)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            if ($nodeVersion instanceof NodeInterface) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findOneByTranslationState from undeclared class \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open

        $status = $this->statusRepository->findOneByTranslationState();
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method dispatch from undeclared class \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

                    $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setName($name);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $parentNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function reorderNodes(array $orderedNodes, NodeInterface $parentNode)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method dispatch from undeclared class \Symfony\Component\EventDispatcher\EventDispatcherInterface
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_CREATION, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function createNewLanguageNode(NodeInterface $node, $language)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setVersion from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant POST_BLOCK_DELETE from undeclared class \OpenOrchestra\ModelInterface\BlockEvents
Open

                    $this->eventDispatcher->dispatch(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $newNode has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findOneByInitial from undeclared class \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open

        $status = $this->statusRepository->findOneByInitial();
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getPath from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            $node->setPath($parentNode->getPath());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getNodeId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

                if ($nodeVersions[0]->getParentId() !== $parentNode->getNodeId()) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setInFooter from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setInFooter(false);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant NODE_CREATION from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open

        $this->eventDispatcher->dispatch(NodeEvents::NODE_CREATION, new NodeEvent($node));
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setLanguage from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setLanguage($language);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method initializeKeywords from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->initializeKeywords();
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant MAX_AGE from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setMaxAge(NodeInterface::MAX_AGE);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Reference to constant TYPE_DEFAULT from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $nodeType = NodeInterface::TYPE_DEFAULT;
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method findByNodeAndSite from undeclared class \OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface
Open

            $nodeVersions = $this->nodeRepository->findByNodeAndSite($nodeId, $parentNode->getSiteId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function hydrateNodeFromNodeId(NodeInterface $node, $nodeId)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setInMenu from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $node->setInMenu(true);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Return type of initializeAreasNode() is undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function initializeAreasNode(NodeInterface $node)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

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

        $site = $this->siteRepository->findOneBySiteId($node->getSiteId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getSiteId from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $site = $this->siteRepository->findOneBySiteId($node->getSiteId());
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Parameter $node has undeclared type \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

    public function setVersionName(NodeInterface $node)
Severity: Minor
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getName from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $versionName = $node->getName() . '_' . $date->format("Y-m-d_H:i:s");
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method setStatus from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $newNode->setStatus($status);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Call to method getTemplate from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

        $areasName = $this->templateManager->getTemplateAreas($node->getTemplate(), $templateSet);
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open

            if ($nodeVersion instanceof NodeInterface) {
Severity: Critical
Found in Backoffice/Manager/NodeManager.php by phan

There must be a single space between the closing parenthesis and the opening brace of a multi-line function declaration; found 0 spaces
Open

    ){

Whitespace found at end of line
Open

     * 

Expected 1 space after FOREACH keyword; 0 found
Open

        foreach($areasName as $areaName) {

There are no issues that match your filters.

Category
Status