ApiBundle/Controller/RedirectionController.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\RedirectionController::get
Open
Open
$repository = $this->get('open_orchestra_model.repository.redirection');
- Create a ticketCreate a ticket
- Exclude checks
Call to method get
from undeclared class \Symfony\Component\HttpFoundation\Request
Open
Open
$format = $request->get('_format', 'json');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::getParameter
Open
Open
$this->getParameter('open_orchestra_api.facade.redirection_collection.class'),
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\ModelInterface\Event\RedirectionEvent
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::dispatchEvent
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$redirection = $this->get('open_orchestra_model.repository.redirection')->find($redirectionId);
- 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
Reference to constant REDIRECTION_DELETE
from undeclared class \OpenOrchestra\ModelInterface\RedirectionEvents
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- 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
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
Class extends undeclared class \OpenOrchestra\BaseApiBundle\Controller\BaseController
Open
Open
class RedirectionController extends BaseController
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
return $this->get('open_orchestra_api.transformer_manager')->transform('redirection_collection', $redirectionList);
- 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 listRedirectionNodeAction()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function listRedirectionNodeAction($siteId, $nodeId, $locale)
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant REDIRECTION_DELETE
from undeclared class \OpenOrchestra\ModelInterface\RedirectionEvents
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::dispatchEvent
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- Create a ticketCreate a ticket
- Exclude checks
Return type of deleteAction()
is undeclared type \Symfony\Component\HttpFoundation\Response
Open
Open
public function deleteAction($redirectionId)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::denyAccessUnlessGranted
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::READ, RedirectionInterface::ENTITY_TYPE);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::isGranted
Open
Open
if ($this->isGranted(ContributionActionInterface::DELETE, $redirection)) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$dm = $this->get('object_manager');
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
Open
if (!$node instanceof NodeInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
Open
public function deleteRedirectionsAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$facade = $this->get('jms_serializer')->deserialize(
- Create a ticketCreate a ticket
- Exclude checks
Call to method getContent
from undeclared class \Symfony\Component\HttpFoundation\Request
Open
Open
$request->getContent(),
- Create a ticketCreate a ticket
- Exclude checks
Returning type array{}
but deleteRedirectionsAction()
is declared to return \Symfony\Component\HttpFoundation\Response
Open
Open
return array();
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\DisplayBundle\Exception\NodeNotFoundException
Open
Open
throw new NodeNotFoundException();
- Create a ticketCreate a ticket
- Exclude checks
Return type of deleteRedirectionsAction()
is undeclared type \Symfony\Component\HttpFoundation\Response
Open
Open
public function deleteRedirectionsAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$node = $this->get('open_orchestra_model.repository.node')->findOneByNodeAndSite($nodeId, $siteId);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$redirections = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('redirection_collection', $facade);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\ModelInterface\Event\RedirectionEvent
Open
Open
$this->dispatchEvent(RedirectionEvents::REDIRECTION_DELETE, new RedirectionEvent($redirection));
- 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\RedirectionController::get
Open
Open
$redirectionRepository = $this->get('open_orchestra_model.repository.redirection');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::denyAccessUnlessGranted
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::READ, $node);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$repository = $this->get('open_orchestra_model.repository.redirection');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\RedirectionController::get
Open
Open
$facade = $this->get('open_orchestra_api.transformer_manager')->transform('redirection_collection', $collection);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant ENTITY_TYPE
from undeclared class \OpenOrchestra\ModelInterface\Model\RedirectionInterface
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::READ, RedirectionInterface::ENTITY_TYPE);
- 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
Avoid excessively long variable names like $redirectionRepository. Keep variable name length under 20. Open
Open
$redirectionRepository = $this->get('open_orchestra_model.repository.redirection');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
Avoid variables with short names like $dm. Configured minimum length is 3. Open
Open
$dm = $this->get('object_manager');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Line exceeds 120 characters; contains 121 characters Open
Open
$facade = $this->get('open_orchestra_api.transformer_manager')->transform('redirection_collection', $collection);
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
Open
return $this->get('open_orchestra_api.transformer_manager')->transform('redirection_collection', $redirectionList);
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
Open
$redirections = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('redirection_collection', $facade);
- Create a ticketCreate a ticket
- Exclude checks