open-orchestra/open-orchestra-cms-bundle

View on GitHub
ApiBundle/Controller/NodeController.php

Summary

Maintainability
C
1 day
Test Coverage

File NodeController.php has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace OpenOrchestra\ApiBundle\Controller;

use Doctrine\Common\Collections\ArrayCollection;
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 4 hrs to fix

The class NodeController has an overall complexity of 53 which is very high. The configured complexity threshold is 50.
Open

class NodeController extends BaseController
{
    use ListStatus;

    /**

The class NodeController has 17 public methods. Consider refactoring NodeController to keep number of public methods under 10.
Open

class NodeController extends BaseController
{
    use ListStatus;

    /**

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Method changeStatusAction has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)
    {
        $facade = $this->get('jms_serializer')->deserialize(
            $request->getContent(),
            'OpenOrchestra\ApiBundle\Facade\NodeFacade',
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 1 hr to fix

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

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)
    {
        $facade = $this->get('jms_serializer')->deserialize(
            $request->getContent(),
            'OpenOrchestra\ApiBundle\Facade\NodeFacade',
Severity: Minor
Found in ApiBundle/Controller/NodeController.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 updateBlockPositionAction has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)
    {
        $node = $this->findOneNode($nodeId, $language, $siteId, $version);
        if (!$node instanceof NodeInterface) {
            throw new NodeNotFoundHttpException();
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 1 hr to fix

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

    public function deleteBlockInAreaAction($nodeId, $siteId, $language, $version, $blockId, $areaName)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 45 mins to fix

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

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 45 mins to fix

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

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 35 mins to fix

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

    public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)
Severity: Minor
Found in ApiBundle/Controller/NodeController.php - About 35 mins to fix

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

class NodeController extends BaseController
{
    use ListStatus;

    /**

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

Avoid using static access to class '\OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration' in method 'listAction'.
Open

        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration' in method 'listUsageBlockAction'.
Open

        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

@throws annotation of showAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function showAction($nodeId, $siteId, $language, $version)

Reference to constant ADD_BLOCK_TO_NODE from undeclared class \OpenOrchestra\ModelInterface\BlockNodeEvents
Open

        $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $objectManager = $this->get('object_manager');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->get('_format', 'json')
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_DUPLICATE, new NodeEvent($newNode));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('node_collection', $nodes);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

    public function listTreeNodeAction($siteId, $language, $parentId = NodeInterface::ROOT_PARENT_ID)
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

Return type of deleteAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function deleteAction($nodeId)

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('node', $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of updateBlockPositionAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

        $this->dispatchEvent(NodeEvents::NODE_DUPLICATE, new NodeEvent($newNode));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodes = $this->get('open_orchestra_model.repository.node')->findByHistoryAndSiteId(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but listTreeNodeAction() is declared to return \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

            return array();

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('nodes_tree', $nodes);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $this->get('open_orchestra_api.transformer_manager')->reverseTransform('node', $facade, array('source' => $node));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            $this->dispatchEvent(NodeEvents::NODE_CHANGE_STATUS, $event);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('node', $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

        $this->dispatchEvent(NodeEvents::NODE_UPDATE_BLOCK_POSITION, new NodeEvent($node, null, $updatedBlock));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                    $node->getLanguage(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Possibly zero references to use statement for classlike/namespace Config (\Sensio\Bundle\FrameworkExtraBundle\Configuration)
Open

use Sensio\Bundle\FrameworkExtraBundle\Configuration as Config;

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::READ, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodeRepository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but deleteBlockInAreaAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

            return array();

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->get('_format', 'json')
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Suspicious array access to \Doctrine\Common\Collections\ArrayCollection
Open

                $blocks[] = $block;

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $originalNodeVersion);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodeManager = $this->get('open_orchestra_backoffice.manager.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->get('_format', 'json')
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $status = $node->getStatus();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                    $node->getSiteId()
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

Returning type array{} but deleteAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $block = $this->get('open_orchestra_model.repository.block')->findById($blockId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of addBlockInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\BlockNotFoundHttpException, which does not extend Error/Exception
Open

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $objectManager = $this->get('object_manager');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->get('_format', 'json')
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_UPDATE_BLOCK_POSITION, new NodeEvent($node, null, $updatedBlock));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of newVersionAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function newVersionAction(Request $request, $nodeId, $language, $originalVersion)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

                $block = $this->get('open_orchestra_model.repository.block')->findById($block->id);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_DUPLICATE, new NodeEvent($newNode));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodeRepository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but newVersionAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

Return type of listStatusesForNodeAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function listStatusesForNodeAction($nodeId, $language, $siteId, $version)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('node_collection', $nodes);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                if ($oldPublishedVersion instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Argument 1 (document) is \OpenOrchestra\ModelInterface\Model\NodeInterface but \OpenOrchestra\ApiBundle\Controller\NodeController::listStatuses() takes \OpenOrchestra\ModelInterface\Model\StatusableInterface defined at /code/ApiBundle/Controller/ControllerTrait/ListStatus.php:17
Open

        return $this->listStatuses($node);

Returning type \OpenOrchestra\WorkflowAdminBundle\Facade\StatusCollectionFacade but listStatusesForNodeAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return $this->listStatuses($node);

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of copyTranslatedBlocksInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\AreaNotFoundHttpException, which does not extend Error/Exception
Open

    public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

Return type of updateBlockPositionAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodes = $this->get('open_orchestra_model.repository.node')->findTreeNode($siteId, $language, $parentId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                    $node->getNodeId(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)

Returning type array{} but updateBlockPositionAction() is declared to return \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        return array();

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $originalNodeVersion = $this->findOneNode($nodeId, $language, $siteId, $originalVersion);

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::isGranted
Open

            if (!$this->isGranted($status, $nodeSource)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Possibly zero references to use statement for classlike/namespace Api (\OpenOrchestra\BaseApiBundle\Controller\Annotation)
Open

use OpenOrchestra\BaseApiBundle\Controller\Annotation as Api;

Class extends undeclared class \OpenOrchestra\BaseApiBundle\Controller\BaseController
Open

class NodeController extends BaseController
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if ($this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $block)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!$block instanceof BlockInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!array_key_exists($areaId, $facade->getAreas()) || null === $node->getArea($areaId)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            array(NodeEvents::NODE_CREATION, NodeEvents::NODE_UPDATE),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of deleteBlockInAreaAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function deleteBlockInAreaAction($nodeId, $siteId, $language, $version, $blockId, $areaName)

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

            $this->dispatchEvent(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::getParameter
Open

        $areaClass = $this->getParameter('open_orchestra_model.document.area.class');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_UPDATE_BLOCK_POSITION, new NodeEvent($node, null, $updatedBlock));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of listTreeNodeAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function listTreeNodeAction($siteId, $language, $parentId = NodeInterface::ROOT_PARENT_ID)

Return type of changeStatusAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)

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

            $event = new NodeEvent($node, $nodeSource->getStatus());
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

                $this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(NodeStrategy::DELETE_VERSION, $node)
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function listUsageBlockAction(Request $request, $siteId, $language, $blockId)

Reference to constant ADD_BLOCK_TO_NODE from undeclared class \OpenOrchestra\ModelInterface\BlockNodeEvents
Open

                $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

                $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

        $this->dispatchEvent(NodeEvents::NODE_DELETE, new NodeDeleteEvent($nodeId, $siteId));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $this->get('open_orchestra_model.repository.node')->removeBlockInArea($blockId, $areaName, $nodeId, $siteId, $language, $version);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but deleteBlockInAreaAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

@throws annotation of addBlockInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotEditableException, which does not extend Error/Exception
Open

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)

Return type of addBlockInAreaAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $area = $node->getArea($areaId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

        $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but addBlockInAreaAction() is declared to return \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        return array();

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of listVersionAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function listVersionAction($nodeId, $language)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('node_collection', $nodes);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

            $this->get('object_manager')->flush();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but changeStatusAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

Expected @param annotation for language to be before the @param annotation for siteId
Open

     * @param string $siteId

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function deleteNodeVersionsAction(Request $request)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

                $blockToTranslate = $this->get('open_orchestra_backoffice.manager.block')->createToTranslateBlock($block, $language);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Expected @param annotation for blockId to be before the @param annotation for areaName
Open

     * @param string  $areaName

Return type of newVersionAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function newVersionAction(Request $request, $nodeId, $language, $originalVersion)

@throws annotation of listStatusesForNodeAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function listStatusesForNodeAction($nodeId, $language, $siteId, $version)

Return type of updateChildrenOrderAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function updateChildrenOrderAction(Request $request, $nodeId)

@throws annotation of deleteAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotDeletableException, which does not extend Error/Exception
Open

    public function deleteAction($nodeId)

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

@throws annotation of addBlockInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function addBlockInAreaAction($nodeId, $language, $version, $blockId, $areaId, $position)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $block = $this->get('open_orchestra_model.repository.block')->findById($blockId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of listNodeWithBlockInAreaAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function listNodeWithBlockInAreaAction($nodeId, $siteId, $areaId)

@throws annotation of changeStatusAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\StatusChangeNotGrantedHttpException, which does not extend Error/Exception
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            $event = new NodeEvent($node, $nodeSource->getStatus());
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $this->get('object_manager')->flush();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of listAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function listAction(Request $request, $siteId, $language)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

            $this->get('object_manager')->flush();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('node_collection', $collection);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of showAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function showAction($nodeId, $siteId, $language, $version)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $node)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_DELETE, new NodeDeleteEvent($nodeId, $siteId));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(NodeEvents::NODE_DELETE, new NodeDeleteEvent($nodeId, $siteId));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

            $objectManager = $this->get('object_manager');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            $this->dispatchEvent(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

            $this->dispatchEvent(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of copyTranslatedBlocksInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)

@throws annotation of updateBlockPositionAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotEditableException, which does not extend Error/Exception
Open

    public function updateBlockPositionAction(Request $request, $nodeId, $language, $version, $siteId)

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method __construct from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

            $blocks = new ArrayCollection();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            $node->setArea($key, $area);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of changeStatusAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodeRepository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if ($status !== $nodeSource->getStatus()) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                $this->dispatchEvent(NodeEvents::NODE_DELETE_VERSION, new NodeEvent($node));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        return $this->get('open_orchestra_model.repository.node')->findInLastVersion($nodeId, $language, $siteId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!$block instanceof BlockInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $block));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of copyTranslatedBlocksInAreaAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function copyTranslatedBlocksInAreaAction(Request $request, $nodeId, $language, $version, $areaId)

Argument 4 (version) is string but \OpenOrchestra\ApiBundle\Controller\NodeController::findOneNode() takes int|null defined at /code/ApiBundle/Controller/NodeController.php:701
Open

        $node = $this->findOneNode($nodeId, $language, $siteId, $version);

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function newVersionAction(Request $request, $nodeId, $language, $originalVersion)

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Return type of listNodeByAuthorAndSiteIdAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function listNodeByAuthorAndSiteIdAction($published)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodes = $this->get('open_orchestra_model.repository.node')->findNotDeletedSortByUpdatedAt($nodeId, $language, $siteId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(NodeStrategy::CHANGE_STATUS, $node)) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

            $this->dispatchEvent(NodeEvents::NODE_CHANGE_STATUS, $event);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!$node instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->get('_format', 'json')
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method generateFromRequest from undeclared class \OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration
Open

        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

    protected function findOneNode($nodeId, $language, $siteId, $version = null)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

                $this->get('open_orchestra_backoffice.manager.node')->deleteBlockInNode($node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

            return $this->get('open_orchestra_model.repository.node')->findVersionNotDeleted($nodeId, $language, $siteId, $version);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

@throws annotation of deleteBlockInAreaAction has suspicious class type \OpenOrchestra\ApiBundle\Exceptions\HttpException\NodeNotFoundHttpException, which does not extend Error/Exception
Open

    public function deleteBlockInAreaAction($nodeId, $siteId, $language, $version, $blockId, $areaName)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $area = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('area', $areaFacade);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('jms_serializer')->deserialize(
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $this->get('object_manager')->flush();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

        if (!$originalNodeVersion instanceof NodeInterface) {
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $objectManager = $this->get('object_manager');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $user = $this->get('security.token_storage')->getToken()->getUser();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

            array(NodeEvents::NODE_CREATION, NodeEvents::NODE_UPDATE),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

                    $this->get('object_manager')->remove($oldPublishedVersion);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::denyAccessUnlessGranted
Open

        $this->denyAccessUnlessGranted(ContributionActionInterface::EDIT, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method getContent from undeclared class \Symfony\Component\HttpFoundation\Request
Open

            $request->getContent(),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                $node->getArea($areaId)->addBlock($blockToTranslate);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function updateChildrenOrderAction(Request $request, $nodeId)

Return type of deleteNodeVersionsAction() is undeclared type \Symfony\Component\HttpFoundation\Response
Open

    public function deleteNodeVersionsAction(Request $request)

Call to method generateFromRequest from undeclared class \OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration
Open

        $configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $objectManager = $this->get('object_manager');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $request has undeclared type \Symfony\Component\HttpFoundation\Request
Open

    public function listAction(Request $request, $siteId, $language)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $facade = $this->get('open_orchestra_api.transformer_manager')->transform('node_collection', $collection);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to method get from undeclared class \Symfony\Component\HttpFoundation\Request
Open

        $format = $request->get('_format', 'json');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodes = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('node_collection', $facade);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $nodeRepository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::isGranted
Open

            if ($this->isGranted(ContributionActionInterface::DELETE, $node) &&
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                $this->dispatchEvent(NodeEvents::NODE_DELETE_VERSION, new NodeEvent($node));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

                $this->dispatchEvent(NodeEvents::NODE_DELETE_VERSION, new NodeEvent($node));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but updateChildrenOrderAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $repository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Returning type array{} but deleteNodeVersionsAction() is declared to return \Symfony\Component\HttpFoundation\Response
Open

        return array();

Return type of listUsageBlockAction() is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function listUsageBlockAction(Request $request, $siteId, $language, $blockId)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $repository = $this->get('open_orchestra_model.repository.node');
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Parameter $area has undeclared type \OpenOrchestra\ModelInterface\Model\AreaInterface
Open

    protected function copyTranslatedBlocks(NodeInterface $node, AreaInterface $area, $language, $areaId)

Call to method getBlocks from undeclared class \OpenOrchestra\ModelInterface\Model\AreaInterface
Open

        $blocks = $area->getBlocks();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                $this->dispatchEvent(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $this->get('open_orchestra_backoffice.manager.node')->reorderNodes($orderedNodes, $node);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

                $this->dispatchEvent(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::dispatchEvent
Open

                $this->dispatchEvent(BlockEvents::POST_BLOCK_CREATE, new BlockEvent($blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::get
Open

        $node = $this->get('open_orchestra_model.repository.node')->findOneByNodeAndSite($nodeId, $siteId);
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\NodeController::getParameter
Open

            $this->getParameter('open_orchestra_api.facade.node_collection.class'),
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

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

    protected function copyTranslatedBlocks(NodeInterface $node, AreaInterface $area, $language, $areaId)

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

                $this->dispatchEvent(BlockNodeEvents::ADD_BLOCK_TO_NODE, new BlockNodeEvent($node, $blockToTranslate));
Severity: Critical
Found in ApiBundle/Controller/NodeController.php by phan

Avoid excessively long variable names like $saveOldPublishedVersion. Keep variable name length under 20.
Open

    public function changeStatusAction(Request $request, $saveOldPublishedVersion)

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Line exceeds 120 characters; contains 122 characters
Open

        $this->get('open_orchestra_api.transformer_manager')->reverseTransform('node', $facade, array('source' => $node));

Line exceeds 120 characters; contains 133 characters
Open

                $blockToTranslate = $this->get('open_orchestra_backoffice.manager.block')->createToTranslateBlock($block, $language);

Line exceeds 120 characters; contains 151 characters
Open

     * @Config\Route("/list/not-published-by-author", name="open_orchestra_api_node_list_author_and_site_not_published", defaults={"published": false})

Line exceeds 120 characters; contains 132 characters
Open

            return $this->get('open_orchestra_model.repository.node')->findVersionNotDeleted($nodeId, $language, $siteId, $version);

Line exceeds 120 characters; contains 138 characters
Open

        $this->get('open_orchestra_model.repository.node')->removeBlockInArea($blockId, $areaName, $nodeId, $siteId, $language, $version);

Line exceeds 120 characters; contains 127 characters
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {

Line exceeds 120 characters; contains 125 characters
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(NodeStrategy::CHANGE_STATUS, $node)) {

Line exceeds 120 characters; contains 126 characters
Open

                $this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(NodeStrategy::DELETE_VERSION, $node)

Line exceeds 120 characters; contains 127 characters
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {

Line exceeds 120 characters; contains 127 characters
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::EDIT, $node)) {

Line exceeds 120 characters; contains 128 characters
Open

        $nodes = $this->get('open_orchestra_model.repository.node')->findNotDeletedSortByUpdatedAt($nodeId, $language, $siteId);

Line exceeds 120 characters; contains 129 characters
Open

        if ($this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $block)) {

Line exceeds 120 characters; contains 129 characters
Open

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $node)) {

Line exceeds 120 characters; contains 122 characters
Open

     * @Config\Route("/list/by-author", name="open_orchestra_api_node_list_author_and_site", defaults={"published": null})

Expected 1 space after IF keyword; 0 found
Open

        if(empty($nodes)) {

There are no issues that match your filters.

Category
Status