open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/Manager/KeywordToDocumentManagerTest.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$entityId'.
Open

    public function addUseInEntity($entityId, $entityType)

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 '$entitytype'.
Open

    public function removeUseInEntity($entityId, $entitytype)

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 '$entityType'.
Open

    public function addUseInEntity($entityId, $entityType)

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 '$entityId'.
Open

    public function removeUseInEntity($entityId, $entitytype)

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 '$entityType'.
Open

    public function getUseReferences($entityType = 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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Parameter $keywordEntity has undeclared type \OpenOrchestra\ModelInterface\Model\KeywordInterface
Open

    public function testGetDocumentException($keyword, $isGranted, $keywordEntity, $created)

Parameter $keywordEntity has undeclared type \OpenOrchestra\ModelInterface\Model\KeywordInterface
Open

    public function testGetDocument($keyword, $isGranted, $keywordEntity, $created)

Call to method when from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

            array('keyword_existing', false, Phake::mock('OpenOrchestra\Backoffice\Tests\Manager\FakeKeyword'), 0),

Call to method mock from undeclared class \Phake
Open

        $this->suppressSpecialCharacterHelper = Phake::mock('OpenOrchestra\ModelInterface\Helper\SuppressSpecialCharacterHelperInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->keywordRepository)->findOneByLabel($keyword)->thenReturn($keywordEntity);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->suppressSpecialCharacterHelper)->transform($keyword)->thenReturn($keyword);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->keywordRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\KeywordRepositoryInterface');

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

Call to method mock from undeclared class \Phake
Open

            array('keyword_existing', true, Phake::mock('OpenOrchestra\Backoffice\Tests\Manager\FakeKeyword'), 0),

Call to method times from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\Manager\KeywordToDocumentManagerTest::setExpectedException
Open

        $this->setExpectedException('Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->keywordRepository)->findOneByLabel($keyword)->thenReturn($keywordEntity);

Class implements undeclared interface \OpenOrchestra\ModelInterface\Model\KeywordInterface
Open

class FakeKeyword implements KeywordInterface

Call to method when from undeclared class \Phake
Open

        Phake::when($this->keywordRepository)->getManager()->thenReturn($this->manager);

Call to method mock from undeclared class \Phake
Open

        $this->manager = Phake::mock('Doctrine\Common\Persistence\ObjectManager');

Call to method mock from undeclared class \Phake
Open

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

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

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

class KeywordToDocumentManagerTest extends AbstractBaseTestCase

Call to method when from undeclared class \Phake
Open

        Phake::when($this->suppressSpecialCharacterHelper)->transform($keyword)->thenReturn($keyword);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

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

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

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 'testGetDocument'.
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

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 'testGetDocumentException'.
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

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 'testGetDocument'.
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

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 'testGetDocumentException'.
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

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 'testGetDocumentException'.
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

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 'provideKeyword'.
Open

            array('keyword_existing', true, Phake::mock('OpenOrchestra\Backoffice\Tests\Manager\FakeKeyword'), 0),

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 'testGetDocument'.
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

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->manager = Phake::mock('Doctrine\Common\Persistence\ObjectManager');

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 'provideKeyword'.
Open

            array('keyword_existing', false, Phake::mock('OpenOrchestra\Backoffice\Tests\Manager\FakeKeyword'), 0),

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 'testGetDocumentException'.
Open

        Phake::verify($this->manager, Phake::times($created))->flush(Phake::anyParameters());

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->keywordRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\KeywordRepositoryInterface');

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->authorizationChecker = Phake::mock('Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface');

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->suppressSpecialCharacterHelper = Phake::mock('OpenOrchestra\ModelInterface\Helper\SuppressSpecialCharacterHelperInterface');

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 'testGetDocumentException'.
Open

        Phake::when($this->authorizationChecker)->isGranted(Phake::anyParameters())->thenReturn($isGranted);

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 'testGetDocument'.
Open

        Phake::verify($this->manager, Phake::times($created))->persist(Phake::anyParameters());

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 excessively long variable names like $suppressSpecialCharacterHelper. Keep variable name length under 20.
Open

    protected $suppressSpecialCharacterHelper;

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

Each class must be in a file by itself
Open

class FakeKeyword implements KeywordInterface

Line exceeds 120 characters; contains 129 characters
Open

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

Line exceeds 120 characters; contains 139 characters
Open

        $this->suppressSpecialCharacterHelper = Phake::mock('OpenOrchestra\ModelInterface\Helper\SuppressSpecialCharacterHelperInterface');

Multi-line function call not indented correctly; expected 8 spaces but found 9
Open

         );

Multi-line function call not indented correctly; expected 8 spaces but found 9
Open

         );

There are no issues that match your filters.

Category
Status