ApiBundle/Controller/TrashcanController.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
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\TrashcanController::get
Open
Open
$repository = $this->get('open_orchestra_model.repository.trash_item');
- 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
Parameter $request
has undeclared type \Symfony\Component\HttpFoundation\Request
Open
Open
public function deleteTrashItemsAction(Request $request)
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::getParameter
Open
Open
$this->getParameter('open_orchestra_api.facade.trash_item_collection.class'),
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$this->get('open_orchestra_model.repository.trash_item')->removeTrashItems($trashItemIds);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$this->get('open_orchestra_backoffice.trashcan_entity.manager')->restore($trashItem);
- 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
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::isGranted
Open
Open
if ($this->isValid($trashItem, 'remove') && $this->isGranted(ContributionActionInterface::TRASH_PURGE)) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::isValid
Open
Open
if ($this->isValid($trashItem, 'remove') && $this->isGranted(ContributionActionInterface::TRASH_PURGE)) {
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$this->get('object_manager')->flush();
- 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
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$om = $this->get('object_manager');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$facade = $this->get('jms_serializer')->deserialize(
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$trashItem = $this->get('open_orchestra_model.repository.trash_item')->find($trashItemId);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$trashItems = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('trash_item_collection', $facade);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$this->get('open_orchestra_backoffice.trashcan_entity.manager')->remove($trashItem);
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\TrashItemInterface
Open
Open
if ($trashItem instanceof TrashItemInterface) {
- 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
Class extends undeclared class \OpenOrchestra\BaseApiBundle\Controller\BaseController
Open
Open
class TrashcanController extends BaseController
- 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\TrashcanController::denyAccessUnlessGranted
Open
Open
$this->denyAccessUnlessGranted(ContributionActionInterface::TRASH_RESTORE, $trashItem);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\ApiBundle\Controller\TrashcanController::get
Open
Open
$facade = $this->get('open_orchestra_api.transformer_manager')->transform('trash_item_collection', $collection);
- Create a ticketCreate a ticket
- Exclude checks
Avoid variables with short names like $om. Configured minimum length is 3. Open
Open
$om = $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 127 characters Open
Open
$trashItems = $this->get('open_orchestra_api.transformer_manager')->reverseTransform('trash_item_collection', $facade);
- Create a ticketCreate a ticket
- Exclude checks