WorkflowAdminBundle/Transformer/StatusTransformer.php
Method transform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function transform($status, array $params = array())
{
if (!$status instanceof StatusInterface) {
throw new TransformerParameterTypeException();
}
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {
$canDelete = $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $status)
&& !$this->usageFinder->hasUsage($status)
&& !$status->isInitialState()
&& !$status->isPublishedState()
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$facadeClass,
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
TranslatorInterface $translator,
AuthorizationCheckerInterface $authorizationChecker,
StatusUsageFinder $usageFinder,
- Create a ticketCreate a ticket
Avoid unused parameters such as '$params'. Open
Open
public function reverseTransform(FacadeInterface $facade, array $params = array())
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$params'. Open
Open
public function transform($status, array $params = array())
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\StatusTransformer::newFacade
Open
Open
$facade = $this->newFacade();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getId
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->id = $status->getId();
- Create a ticketCreate a ticket
- Exclude checks
Parameter $multiLanguagesChoiceManager
has undeclared type \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open
Open
parent::__construct($facadeClass, $authorizationChecker);
- Create a ticketCreate a ticket
- Exclude checks
Call to method isInitialState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->initialState = $status->isInitialState();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isAutoPublishFromState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->autoPublishFromState = $status->isAutoPublishFromState();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getLabels
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->label = $this->multiLanguagesChoiceManager->choose($status->getLabels());
- Create a ticketCreate a ticket
- Exclude checks
Call to method isAutoUnpublishToState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
&& !$status->isAutoUnpublishToState();
- Create a ticketCreate a ticket
- Exclude checks
Parameter $statusRepository
has undeclared type \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Parameter $status
has undeclared type \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
public function transform($status, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method isAutoUnpublishToState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->autoUnpublishToState = $status->isAutoUnpublishToState();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getName
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->name = $status->getName();
- Create a ticketCreate a ticket
- Exclude checks
Call to method choose
from undeclared class \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open
Open
$facade->label = $this->multiLanguagesChoiceManager->choose($status->getLabels());
- Create a ticketCreate a ticket
- Exclude checks
Call to method find
from undeclared class \OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface
Open
Open
return $this->statusRepository->find($facade->id);
- Create a ticketCreate a ticket
- Exclude checks
Call to method isAutoPublishFromState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
&& !$status->isAutoPublishFromState()
- Create a ticketCreate a ticket
- Exclude checks
Parameter $translator
has undeclared type \Symfony\Component\Translation\TranslatorInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Call to method isPublishedState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->publishedState = $status->isPublishedState();
- Create a ticketCreate a ticket
- Exclude checks
Call to method isTranslationState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->translationState = $status->isTranslationState();
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open
Open
class StatusTransformer extends AbstractSecurityCheckerAwareTransformer
- Create a ticketCreate a ticket
- Exclude checks
Parameter $authorizationChecker
has undeclared type \Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
Open
Open
public function __construct(
- Create a ticketCreate a ticket
- Exclude checks
Checking instanceof against undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
if (!$status instanceof StatusInterface) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method isInitialState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
&& !$status->isInitialState()
- Create a ticketCreate a ticket
- Exclude checks
Return type of reverseTransform()
is undeclared type \OpenOrchestra\WorkflowAdminBundle\Transformer\UserInterface
Open
Open
public function reverseTransform(FacadeInterface $facade, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method getDisplayColor
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->displayColor = $this->translator->trans('open_orchestra_workflow_admin.form.status.color.' . $status->getDisplayColor());
- Create a ticketCreate a ticket
- Exclude checks
Parameter $facade
has undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function reverseTransform(FacadeInterface $facade, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property id
from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
if (null !== $facade->id) {
- Create a ticketCreate a ticket
- Exclude checks
Call to method isPublishedState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
&& !$status->isPublishedState()
- Create a ticketCreate a ticket
- Exclude checks
Call to method isTranslationState
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
&& !$status->isTranslationState()
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\StatusTransformer::hasGroup
Open
Open
return $this->hasGroup(CMSGroupContext::STATUS);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open
Open
throw new TransformerParameterTypeException();
- Create a ticketCreate a ticket
- Exclude checks
Return type of transform()
is undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
public function transform($status, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Call to method isBlockedEdition
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->blockedEdtion = $status->isBlockedEdition();
- Create a ticketCreate a ticket
- Exclude checks
Call to method getDisplayColor
from undeclared class \OpenOrchestra\ModelInterface\Model\StatusInterface
Open
Open
$facade->codeColor = $status->getDisplayColor();
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\StatusTransformer::hasGroup
Open
Open
if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {
- Create a ticketCreate a ticket
- Exclude checks
@throws type of transform
has undeclared type \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open
Open
public function transform($status, array $params = array())
- Create a ticketCreate a ticket
- Exclude checks
Reference to instance property id
from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open
Open
return $this->statusRepository->find($facade->id);
- Create a ticketCreate a ticket
- Exclude checks
Call to method trans
from undeclared class \Symfony\Component\Translation\TranslatorInterface
Open
Open
$facade->displayColor = $this->translator->trans('open_orchestra_workflow_admin.form.status.color.' . $status->getDisplayColor());
- Create a ticketCreate a ticket
- Exclude checks
Reference to undeclared property \OpenOrchestra\WorkflowAdminBundle\Transformer\StatusTransformer->authorizationChecker
Open
Open
$canDelete = $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $status)
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $multiLanguagesChoiceManager. Keep variable name length under 20. Open
Open
protected $multiLanguagesChoiceManager;
- 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 excessively long variable names like $multiLanguagesChoiceManager. Keep variable name length under 20. Open
Open
MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,
- 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
Line exceeds 120 characters; contains 138 characters Open
Open
$facade->displayColor = $this->translator->trans('open_orchestra_workflow_admin.form.status.color.' . $status->getDisplayColor());
- Create a ticketCreate a ticket
- Exclude checks