open-orchestra/open-orchestra-cms-bundle

View on GitHub
ApiBundle/Controller/BlockController.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '150', column '23').
Open

            throw new \UnexpectedValueException();

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

Missing class import via use statement (line '96', column '23').
Open

            throw new \UnexpectedValueException();

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

Avoid using static access to class '\OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration' in method 'listSharedBlockTableAction'.
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

Possibly zero references to use statement for classlike/namespace ContributionRoleInterface (\OpenOrchestra\Backoffice\Security\ContributionRoleInterface)
Open

use OpenOrchestra\Backoffice\Security\ContributionRoleInterface;

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\BlockController::get
Open

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

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

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

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

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

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

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

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

    public function listSharedBlockTableAction(Request $request, $language)

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

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

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

    public function deleteBlockAction($blockId)

Call to undeclared method \OpenOrchestra\ApiBundle\Controller\BlockController::createAccessDeniedException
Open

            $this->createAccessDeniedException();
Severity: Critical
Found in ApiBundle/Controller/BlockController.php by phan

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

        $this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, BlockInterface::ENTITY_TYPE);
Severity: Critical
Found in ApiBundle/Controller/BlockController.php by phan

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

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

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

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

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

        $this->dispatchEvent(BlockEvents::POST_BLOCK_DELETE, new BlockEvent($block));
Severity: Critical
Found in ApiBundle/Controller/BlockController.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/BlockController.php by phan

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

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

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

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

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

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

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

        return array();

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

    public function listSharedBlockByComponentAction($language, $component)

Call to method setTransverse from undeclared class \OpenOrchestra\ModelInterface\Model\BlockInterface
Open

        $block->setTransverse(true);
Severity: Critical
Found in ApiBundle/Controller/BlockController.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;

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

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

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/BlockController.php by phan

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

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

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

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

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

        $this->denyAccessUnlessGranted(ContributionActionInterface::CREATE, BlockInterface::ENTITY_TYPE);
Severity: Critical
Found in ApiBundle/Controller/BlockController.php by phan

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

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

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

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

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

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

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

    public function shareBlockAction($blockId)

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

    public function listAvailableBlockComponentAction()

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

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

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

            $components = $this->get('open_orchestra_backoffice.manager.block_configuration')->getComponentsWithCategory($configuration->getSearchIndex('category'));
Severity: Critical
Found in ApiBundle/Controller/BlockController.php by phan

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

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

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

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

@throws type of shareBlockAction has undeclared type \OpenOrchestra\BaseApi\Exceptions\HttpException\ClientAccessDeniedHttpException
Open

    public function shareBlockAction($blockId)

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

    public function listSharedBlockTableAction(Request $request, $language)

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

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

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

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

@throws type of shareBlockAction has undeclared type \OpenOrchestra\ApiBundle\Controller\UnexpectedValueException (Did you mean class \UnexpectedValueException)
Open

    public function shareBlockAction($blockId)

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/BlockController.php by phan

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

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

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

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

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

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

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

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

Line exceeds 120 characters; contains 127 characters
Open

        return $this->get('open_orchestra_api.transformer_manager')->transform('block_component_collection', $availableBlocks);

Line exceeds 120 characters; contains 130 characters
Open

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

Line exceeds 120 characters; contains 165 characters
Open

            $components = $this->get('open_orchestra_backoffice.manager.block_configuration')->getComponentsWithCategory($configuration->getSearchIndex('category'));

There are no issues that match your filters.

Category
Status