open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/Security/Authorization/Voter/AbstractVoterTest.php

Summary

Maintainability
A
3 hrs
Test Coverage

AbstractVoterTest has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class AbstractVoterTest extends AbstractBaseTestCase
{
    protected $voter;

    protected $perimeterManager;
Severity: Minor
Found in Backoffice/Tests/Security/Authorization/Voter/AbstractVoterTest.php - About 2 hrs to fix

Method testVote has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function testVote($object, $attribute, array $roles, $inPerimeter, $expectedVote)
Severity: Minor
Found in Backoffice/Tests/Security/Authorization/Voter/AbstractVoterTest.php - About 35 mins to fix

The method createPhakeNodeNotHydrated has a boolean flag argument $owner, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function createPhakeNodeNotHydrated($owner = false)

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method createPhakeNode has a boolean flag argument $owner, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function createPhakeNode($owner = false)

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method createPhakeContent has a boolean flag argument $owner, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function createPhakeContent($owner = false)

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class '\Phake' in method 'createPhakeTransition'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowTransitionInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

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

Avoid using static access to class '\Phake' in method 'createPhakeWorkflowProfile'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeContentType'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

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

Avoid using static access to class '\Phake' in method 'testVote'.
Open

        Phake::when($this->perimeterManager)->isInPerimeter(Phake::anyParameters())->thenReturn($inPerimeter);

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

Avoid using static access to class '\Phake' in method 'createPhakeSite'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->perimeter = Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeApiClient'.
Open

        return Phake::mock('OpenOrchestra\BaseApi\Model\ApiClientInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->accessDecisionManager = Phake::mock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeLog'.
Open

        return Phake::mock('OpenOrchestra\LogBundle\Model\LogInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeRedirection'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        Phake::when($this->perimeter)->getItems(Phake::anyParameters())->thenReturn(array());

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->perimeterManager = Phake::mock('OpenOrchestra\Backoffice\Perimeter\PerimeterManager');

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

Avoid using static access to class '\Phake' in method 'createPhakeKeyword'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\KeywordInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeStatus'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeContent'.
Open

        $content = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeGroup'.
Open

        $group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->token = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

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

Avoid using static access to class '\Phake' in method 'testVote'.
Open

            Phake::when($this->accessDecisionManager)->decide(Phake::anyParameters())->thenReturn(true);

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        $this->user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeTrashItem'.
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\TrashItemInterface');

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

Avoid using static access to class '\Phake' in method 'createPhakeNode'.
Open

        $node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

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

Avoid using static access to class '\Phake' in method 'setUp'.
Open

        Phake::when($this->group)->getPerimeter(Phake::anyParameters())->thenReturn($this->perimeter);

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

Avoid using static access to class '\Phake' in method 'createPhakeUser'.
Open

        $user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

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 method when from undeclared class \Phake
Open

        Phake::when($this->user)->getGroups()->thenReturn(array($this->group));

Return type of createPhakeTrashItem() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeTrashItem()

Return type of createPhakeRedirection() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeRedirection()

Call to method mock from undeclared class \Phake
Open

        $group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');

Return type of createPhakeWorkflowProfile() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeWorkflowProfile()

Call to method when from undeclared class \Phake
Open

        Phake::when($this->perimeterManager)->isInPerimeter(Phake::anyParameters())->thenReturn($inPerimeter);

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');

Return type of createPhakeSite() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeSite()

Return type of createPhakeUser() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeUser()

Call to method mock from undeclared class \Phake
Open

        $user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

Call to method mock from undeclared class \Phake
Open

        $this->perimeterManager = Phake::mock('OpenOrchestra\Backoffice\Perimeter\PerimeterManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->group)->getPerimeter(Phake::anyParameters())->thenReturn($this->perimeter);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->user)->getUsername()->thenReturn($this->username);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->token)->getUser()->thenReturn($this->user);

Call to method mock from undeclared class \Phake
Open

        $this->accessDecisionManager = Phake::mock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->token)->getRoles()->thenReturn($roles);

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

Return type of createPhakeTransition() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeTransition()

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\KeywordInterface');

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\AbstractVoterTest::assertEquals
Open

        $this->assertEquals($expectedVote, $vote);

Return type of createPhakeNodeNotHydrated() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeNodeNotHydrated($owner = false)

Return type of createPhakeStatus() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeStatus()

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->perimeter)->getItems(Phake::anyParameters())->thenReturn(array());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

Call to method when from undeclared class \Phake
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->group)->getPerimeter(Phake::anyParameters())->thenReturn($this->perimeter);

Call to method mock from undeclared class \Phake
Open

        $this->user = Phake::mock('OpenOrchestra\UserBundle\Model\UserInterface');

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\LogBundle\Model\LogInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($user)->getGroups()->thenReturn(array($group));

Return type of createPhakeContentType() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeContentType()

Call to method anyParameters from undeclared class \Phake
Open

            Phake::when($this->accessDecisionManager)->decide(Phake::anyParameters())->thenReturn(true);

Call to method mock from undeclared class \Phake
Open

        $node = Phake::mock('OpenOrchestra\ModelInterface\Model\NodeInterface');

Call to method mock from undeclared class \Phake
Open

        $this->perimeter = Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface');

Call to method mock from undeclared class \Phake
Open

        $this->group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');

Call to method mock from undeclared class \Phake
Open

        $this->token = Phake::mock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->perimeterManager)->isInPerimeter(Phake::anyParameters())->thenReturn($inPerimeter);

Return type of createPhakeLog() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeLog()

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowTransitionInterface');

Call to method mock from undeclared class \Phake
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

Return type of createPhakeNode() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeNode($owner = false)

Call to method when from undeclared class \Phake
Open

            Phake::when($node)->getCreatedBy()->thenReturn($this->username);

Return type of createPhakeKeyword() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeKeyword()

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\BaseApi\Model\ApiClientInterface');

Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open

abstract class AbstractVoterTest extends AbstractBaseTestCase

Call to method when from undeclared class \Phake
Open

            Phake::when($this->accessDecisionManager)->decide(Phake::anyParameters())->thenReturn(true);

Returning type array{createdBy:string,nodeId:'fakeNodeId',path:'fakePath'}|array{nodeId:'fakeNodeId',path:'fakePath'} but createPhakeNodeNotHydrated() is declared to return \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

        return $node;

Call to method when from undeclared class \Phake
Open

            Phake::when($content)->getCreatedBy()->thenReturn($this->username);

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\RedirectionInterface');

Return type of createPhakeGroup() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeGroup()

Return type of createPhakeApiClient() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeApiClient()

Call to method mock from undeclared class \Phake
Open

        $content = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentInterface');

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\TrashItemInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->perimeter)->getItems(Phake::anyParameters())->thenReturn(array());

Call to method mock from undeclared class \Phake
Open

        return Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');

Return type of createPhakeContent() is undeclared type \OpenOrchestra\Backoffice\Tests\Security\Authorization\Voter\Phake_IMock
Open

    protected function createPhakeContent($owner = false)

Call to method when from undeclared class \Phake
Open

        Phake::when($group)->getSite()->thenReturn($site);

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

    protected $accessDecisionManager;

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 164 characters
Open

        Phake::when($this->perimeterManager)->createPerimeter(Phake::anyParameters())->thenReturn(Phake::mock('OpenOrchestra\Backoffice\Model\PerimeterInterface'));

Line exceeds 120 characters; contains 132 characters
Open

        if (in_array(ContributionRoleInterface::PLATFORM_ADMIN, $roles) || in_array(ContributionRoleInterface::DEVELOPER, $roles)) {

Line exceeds 120 characters; contains 131 characters
Open

        $this->accessDecisionManager = Phake::mock('Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface');

There are no issues that match your filters.

Category
Status