ApiBundle/Controller/SiteController.php
Avoid using static access to class '\OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration' in method 'listAction'. Open
Open
$configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
if (false === $this->get('security.authorization_checker')->isGranted(ContributionRoleInterface::PLATFORM_ADMIN)) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
return $this->get('open_orchestra_api.transformer_manager')->transform('site_collection', $availableSite);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::denyAccessUnlessGranted
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $site);
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
if ($site instanceof SiteInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$this->get('object_manager')->flush();
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$repository = $this->get('open_orchestra_model.repository.site');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant SITE_DELETE
from undeclared class \OpenOrchestra\ModelInterface\SiteEvents
Open
Open
$this->dispatchEvent(SiteEvents::SITE_DELETE, new SiteEvent($site));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::denyAccessUnlessGranted
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::READ, SiteInterface::ENTITY_TYPE);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$facade = $this->get('open_orchestra_api.transformer_manager')->transform('site_collection', $collection);
- Create a ticketCreate a ticket
- Exclude checks
Possibly zero references to use statement for classlike/namespace Config
(\Sensio\Bundle\FrameworkExtraBundle\Configuration)
Open
Open
use Sensio\Bundle\FrameworkExtraBundle\Configuration as Config;
- Create a ticketCreate a ticket
- Exclude checks
Call to method generateFromRequest
from undeclared class \OpenOrchestra\Pagination\Configuration\PaginateFinderConfiguration
Open
Open
$configuration = PaginateFinderConfiguration::generateFromRequest($request, $mapping);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$availableSite = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getAvailableSites();
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::dispatchEvent
Open
Open
$this->dispatchEvent(SiteEvents::SITE_DELETE, new SiteEvent($site));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
- Create a ticketCreate a ticket
- Exclude checks
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
Open
public function listAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Return type of listAction()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function listAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseApiBundle\Controller\BaseController
Open
Open
class SiteController extends BaseController
- Create a ticketCreate a ticket
- Exclude checks
Call to method setDeleted
from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
$site->setDeleted(true);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\ModelInterface\Event\SiteEvent
Open
Open
$this->dispatchEvent(SiteEvents::SITE_DELETE, new SiteEvent($site));
- Create a ticketCreate a ticket
- Exclude checks
Return type of deleteAction()
is undeclared type \Symfony\Component\HttpFoundation\Response
Open
Open
public function deleteAction($siteId)
- Create a ticketCreate a ticket
- Exclude checks
Returning type array{}
but deleteAction()
is declared to return \Symfony\Component\HttpFoundation\Response
Open
Open
return array();
- Create a ticketCreate a ticket
- Exclude checks
Possibly zero references to use statement for classlike/namespace Api
(\OpenOrchestra\BaseApiBundle\Controller\Annotation)
Open
Open
use OpenOrchestra\BaseApiBundle\Controller\Annotation as Api;
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\SiteInterface
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::READ, SiteInterface::ENTITY_TYPE);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\SiteController::get
Open
Open
$availableSites = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getAvailableSites();
- Create a ticketCreate a ticket
- Exclude checks
Return type of listAvailableSiteAction()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function listAvailableSiteAction()
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
if (false === $this->get('security.authorization_checker')->isGranted(ContributionRoleInterface::PLATFORM_ADMIN)) {
- Create a ticketCreate a ticket
- Exclude checks