open-orchestra/open-orchestra-cms-bundle

View on GitHub
Backoffice/Tests/EventSubscriber/ContentTypeSubscriberTest.php

Summary

Maintainability
B
5 hrs
Test Coverage

Method setUp has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setUp()
    {
        $this->fieldTypesConfiguration = array(
            'text' =>
                array(
Severity: Major
Found in Backoffice/Tests/EventSubscriber/ContentTypeSubscriberTest.php - About 2 hrs to fix

Method testSubmitWithExistingData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSubmitWithExistingData()
    {
        $name = 'name';
        $status = 'status';
        $language = 'fr';
Severity: Minor
Found in Backoffice/Tests/EventSubscriber/ContentTypeSubscriberTest.php - About 1 hr to fix

The class ContentTypeSubscriberTest has 21 fields. Consider redesigning ContentTypeSubscriberTest to keep the number of fields under 15.
Open

class ContentTypeSubscriberTest extends AbstractBaseTestCase
{
    /**
     * @var ContentTypeSubscriber
     */

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

Source https://phpmd.org/rules/codesize.html#toomanyfields

Method testSubmitWithNoExistingData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testSubmitWithNoExistingData()
    {
        $name = 'name';
        $status = 'status';
        $language = 'fr';
Severity: Minor
Found in Backoffice/Tests/EventSubscriber/ContentTypeSubscriberTest.php - About 1 hr to fix

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

        $this->contentType = 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 'setUp'.
Open

        Phake::when($this->form)->get(Phake::anyParameters())->thenReturn($this->subForm);

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

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

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->form = Phake::mock('Symfony\Component\Form\Form');

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->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

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->contentAttribute = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentAttributeInterface');

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

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->repository)->findOneByContentTypeIdInLastVersion(Phake::anyParameters())->thenReturn($this->contentType);

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->fieldType3 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

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

        Phake::verify($this->content)->addAttribute(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->event = Phake::mock('Symfony\Component\Form\FormEvent');

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->fieldType2 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

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

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($label);

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->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

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

        $translator = Phake::mock('Symfony\Component\Translation\Translator');

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->subForm = Phake::mock('Symfony\Component\Form\Form');

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->fieldType1 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

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->content)->getAttributeByName(Phake::anyParameters())->thenReturn($this->contentAttribute);

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->repository)->find(Phake::anyParameters())->thenReturn($this->contentType);

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->valueTransformerManager = Phake::mock('OpenOrchestra\Backoffice\ValueTransformer\ValueTransformerManager');

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->formConfig = Phake::mock('Symfony\Component\Form\FormConfigInterface');

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->valueTransformerManager)->transform(Phake::anyParameters())->thenReturn('foo');

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

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

Call to method mock from undeclared class \Phake
Open

        $this->valueTransformerManager = Phake::mock('OpenOrchestra\Backoffice\ValueTransformer\ValueTransformerManager');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getFormOptions()->thenReturn($options);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->subForm)->getData();

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->valueTransformerManager)->transform('bar', $realValueArray);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->subForm)->getData()->thenReturn($title);

Call to method mock from undeclared class \Phake
Open

        $this->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

Reference to constant POST_SUBMIT from undeclared class \Symfony\Component\Form\FormEvents
Open

        $this->assertArrayHasKey(FormEvents::POST_SUBMIT, $this->subscriber->getSubscribedEvents());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->event)->getData()->thenReturn($data);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->form)->getData();

Call to method when from undeclared class \Phake
Open

        Phake::when($this->content)->getAttributeByName(Phake::anyParameters())->thenReturn($this->contentAttribute);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentType)->getFields()->thenReturn($this->fieldCollection);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->valueTransformerManager)->transform(Phake::anyParameters())->thenReturn('foo');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->contentAttribute)->setStringValue('foo');

Call to method mock from undeclared class \Phake
Open

        $this->form = Phake::mock('Symfony\Component\Form\Form');

Call to method mock from undeclared class \Phake
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->event)->getData()->thenReturn($this->content);

Call to method __construct from undeclared class \Symfony\Component\Validator\Constraints\NotBlank
Open

        $this->constraintsNotBlank =  new NotBlank();

Call to method when from undeclared class \Phake
Open

        Phake::when($this->event)->getData()->thenReturn($data);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->form)->getData();

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->form)->get(Phake::anyParameters())->thenReturn($this->subForm);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getLabels()->thenReturn(array());

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->content)->getAttributeByName($fieldId);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::verify($this->content)->addAttribute(Phake::anyParameters());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->formConfig)->getModelTransformers()->thenReturn(array());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->formConfig)->getViewTransformers()->thenReturn(array());

Call to method mock from undeclared class \Phake
Open

        $this->fieldType2 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

Call to method mock from undeclared class \Phake
Open

        $this->eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');

Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeSubscriberTest::assertArrayHasKey
Open

        $this->assertArrayHasKey(FormEvents::POST_SET_DATA, $this->subscriber->getSubscribedEvents());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->form)->getData()->thenReturn($this->content);

Call to method add from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $this->fieldCollection->add($this->fieldType1);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getType()->thenReturn($type);

Call to method mock from undeclared class \Phake
Open

        $this->contentAttribute = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentAttributeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->contentAttribute)->getType()->thenReturn("bar");

Call to method when from undeclared class \Phake
Open

        Phake::when($this->event)->getForm()->thenReturn($this->form);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($label);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->repository)->findOneByContentTypeIdInLastVersion($realContentTypeId);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->repository)->findOneByContentTypeIdInLastVersion($realContentTypeId);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->content)->addAttribute(Phake::anyParameters());

Call to method mock from undeclared class \Phake
Open

        $this->subForm = Phake::mock('Symfony\Component\Form\Form');

Call to method mock from undeclared class \Phake
Open

        $this->contentType = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->repository)->findOneByContentTypeIdInLastVersion(Phake::anyParameters())->thenReturn($this->contentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->repository)->find(Phake::anyParameters())->thenReturn($this->contentType);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->contentAttribute)->setValue($realValueArray);

Call to method mock from undeclared class \Phake
Open

        $this->event = Phake::mock('Symfony\Component\Form\FormEvent');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType2)->getLabels()->thenReturn(array());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType3)->getLabels()->thenReturn(array());

Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeSubscriberTest::assertArrayHasKey
Open

        $this->assertArrayHasKey(FormEvents::POST_SUBMIT, $this->subscriber->getSubscribedEvents());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->subForm)->getData()->thenReturn($realValueArray);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getDefaultValue()->thenReturn($defaultValue);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->content)->getAttributeByName($fieldId)->thenReturn(null);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->content)->getAttributeByName($fieldId);

Call to method mock from undeclared class \Phake
Open

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

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->repository)->find(Phake::anyParameters())->thenReturn($this->contentType);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getDefaultValue()->thenReturn($defaultValue);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->repository)->findOneByContentTypeIdInLastVersion(Phake::anyParameters())->thenReturn($this->contentType);

Reference to constant POST_SET_DATA from undeclared class \Symfony\Component\Form\FormEvents
Open

        $this->assertArrayHasKey(FormEvents::POST_SET_DATA, $this->subscriber->getSubscribedEvents());

Call to method when from undeclared class \Phake
Open

        Phake::when($this->content)->getAttributeByName($fieldId)->thenReturn($this->contentAttribute);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->contentAttribute)->setType($type);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getFieldId()->thenReturn($fieldId);

Call to method mock from undeclared class \Phake
Open

        $this->fieldType1 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->valueTransformerManager)->transform(null, $title);

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

class ContentTypeSubscriberTest extends AbstractBaseTestCase

Call to method mock from undeclared class \Phake
Open

        $this->fieldType3 = Phake::mock('OpenOrchestra\ModelInterface\Model\FieldTypeInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->fieldType1)->getFieldId()->thenReturn($fieldId);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->form)->get(Phake::anyParameters())->thenReturn($this->subForm);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->form)->getConfig()->thenReturn($this->formConfig);

Call to method anyParameters from undeclared class \Phake
Open

        Phake::when($this->content)->getAttributeByName(Phake::anyParameters())->thenReturn($this->contentAttribute);

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeSubscriberTest->statusRepository
Open

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

Call to method when from undeclared class \Phake
Open

        Phake::when($this->valueTransformerManager)->transform(Phake::anyParameters())->thenReturn('foo');

Call to method mock from undeclared class \Phake
Open

        $translator = Phake::mock('Symfony\Component\Translation\Translator');

Call to method add from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $this->fieldCollection->add($this->fieldType1);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->multiLanguagesChoiceManager)->choose(Phake::anyParameters())->thenReturn($label);

Call to method verify from undeclared class \Phake
Open

        Phake::verify($this->subForm)->getData();

Call to method mock from undeclared class \Phake
Open

        $this->formConfig = Phake::mock('Symfony\Component\Form\FormConfigInterface');

Call to method when from undeclared class \Phake
Open

        Phake::when($this->content)->getContentType()->thenReturn($this->contentTypeId);

Call to method __construct from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open

        $this->fieldCollection = new ArrayCollection();

Reference to undeclared property \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeSubscriberTest->statusRepository
Open

            $this->statusRepository,

Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeSubscriberTest::assertInstanceOf
Open

        $this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);

Call to method when from undeclared class \Phake
Open

        Phake::when($this->form)->getData()->thenReturn($this->content);

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

    protected $valueTransformerManager;

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

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

    protected $fieldTypesConfiguration;

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

    protected $contentAttributeClass;

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

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Line exceeds 120 characters; contains 134 characters
Open

        $this->multiLanguagesChoiceManager = Phake::mock('OpenOrchestra\ModelInterface\Manager\MultiLanguagesChoiceManagerInterface');

Line exceeds 120 characters; contains 122 characters
Open

        $this->valueTransformerManager = Phake::mock('OpenOrchestra\Backoffice\ValueTransformer\ValueTransformerManager');

Line exceeds 120 characters; contains 132 characters
Open

        Phake::when($this->repository)->findOneByContentTypeIdInLastVersion(Phake::anyParameters())->thenReturn($this->contentType);

There are no issues that match your filters.

Category
Status