open-orchestra/open-orchestra-cms-bundle

View on GitHub
WorkflowAdminBundle/Transformer/WorkflowProfileTransformer.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$params'.
Open

    public function transform($workflowProfile, array $params = array())

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

    public function reverseTransform(FacadeInterface $facade, array $params = array())

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

@throws type of transform has undeclared type \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open

    public function transform($workflowProfile, array $params = array())

Call to method choose from undeclared class \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open

        $facade->description = $this->multiLanguagesChoiceManager->choose($workflowProfile->getDescriptions());

Call to method getTransitions from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

        foreach ($workflowProfile->getTransitions() as $transition) {

Call to method getDescriptions from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

        $facade->description = $this->multiLanguagesChoiceManager->choose($workflowProfile->getDescriptions());

Reference to instance property id from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

        if (null !== $facade->id) {

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\WorkflowProfileTransformer::newFacade
Open

        $facade = $this->newFacade();

Parameter $multiLanguagesChoiceManager has undeclared type \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open

    public function __construct(

Class extends undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open

class WorkflowProfileTransformer extends AbstractSecurityCheckerAwareTransformer

Parameter $facade has undeclared type \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

    public function reverseTransform(FacadeInterface $facade, array $params = array())

Parameter $workflowProfileRepository has undeclared type \OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface
Open

    public function __construct(

Parameter $workflowProfile has undeclared type \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

    public function transform($workflowProfile, array $params = array())

Call to method find from undeclared class \OpenOrchestra\ModelInterface\Repository\WorkflowProfileRepositoryInterface
Open

            return $this->workflowProfileRepository->find($facade->id);

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

        if (!$workflowProfile instanceof WorkflowProfileInterface) {

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\WorkflowProfileTransformer::getTransformer
Open

            $facade->addTransition($this->getTransformer('workflow_transition')->transform($transition));

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

    public function transform($workflowProfile, array $params = array())

Reference to undeclared class \OpenOrchestra\BaseApi\Transformer\AbstractSecurityCheckerAwareTransformer
Open

        parent::__construct($facadeClass, $authorizationChecker);

Call to method getId from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

        $facade->id = $workflowProfile->getId();

Return type of reverseTransform() is undeclared type \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

    public function reverseTransform(FacadeInterface $facade, array $params = array())

Reference to instance property id from undeclared class \OpenOrchestra\BaseApi\Facade\FacadeInterface
Open

            return $this->workflowProfileRepository->find($facade->id);

Parameter $authorizationChecker has undeclared type \Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
Open

    public function __construct(

Call to undeclared method \OpenOrchestra\WorkflowAdminBundle\Transformer\WorkflowProfileTransformer::hasGroup
Open

        if ($this->hasGroup(CMSGroupContext::AUTHORIZATIONS)) {

Call to method __construct from undeclared class \OpenOrchestra\BaseApi\Exceptions\TransformerParameterTypeException
Open

            throw new TransformerParameterTypeException();

Call to method choose from undeclared class \OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface
Open

        $facade->label = $this->multiLanguagesChoiceManager->choose($workflowProfile->getLabels());

Call to method getLabels from undeclared class \OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface
Open

        $facade->label = $this->multiLanguagesChoiceManager->choose($workflowProfile->getLabels());

Reference to undeclared property \OpenOrchestra\WorkflowAdminBundle\Transformer\WorkflowProfileTransformer->authorizationChecker
Open

            $canDelete = $this->authorizationChecker->isGranted(ContributionActionInterface::DELETE, $workflowProfile);

Avoid excessively long variable names like $multiLanguagesChoiceManager. Keep variable name length under 20.
Open

    protected $multiLanguagesChoiceManager;

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

        MultiLanguagesChoiceManagerInterface $multiLanguagesChoiceManager,

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 $workflowProfileRepository. Keep variable name length under 20.
Open

        WorkflowProfileRepositoryInterface   $workflowProfileRepository

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 $workflowProfileRepository. Keep variable name length under 20.
Open

    protected $workflowProfileRepository;

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

There are no issues that match your filters.

Category
Status