Method testAddWorkflowProfile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAddWorkflowProfile()
{
$event = Phake::mock('OpenOrchestra\GroupBundle\Event\GroupFormEvent');
$builder = Phake::mock('Symfony\Component\Form\FormBuilderInterface');
$group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');
- Create a ticketCreate a ticket
Avoid using static access to class '\Phake' in method 'setUp'. Open
$workflowProfileCollectionTransformer = Phake::mock('Symfony\Component\Form\DataTransformerInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::verify($builder, Phake::times(2))->setAttribute(Phake::anyParameters());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::verify($builder, Phake::times(1))->addModelTransformer(Phake::anyParameters());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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($translator)->trans(Phake::anyParameters())->thenReturn('fakeTrans');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
$builder = Phake::mock('Symfony\Component\Form\FormBuilderInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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\TranslatorInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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($workflowProfile)->getLabel(\Phake::anyParameters())->thenReturn('fakeWorkflowProfileLabel');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
$workflowProfile = Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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->contenType = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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($contentTypeRepository)->findAllNotDeletedInLastVersion(Phake::anyParameters())->thenReturn(array($this->contenType));
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::when($builder)->get(Phake::anyParameters())->thenReturn($builder);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
$workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\WorkflowProfileRepository');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
$contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
$site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
$event = Phake::mock('OpenOrchestra\GroupBundle\Event\GroupFormEvent');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::verify($builder, Phake::times(1))->add('workflow_profile_collections', 'oo_check_list_collection', array(
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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->contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
$group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::verify($builder, Phake::times(2))->setAttribute(Phake::anyParameters());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
$contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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 'testAddWorkflowProfile'. Open
Phake::verify($builder, Phake::times(1))->addModelTransformer(Phake::anyParameters());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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
$workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\WorkflowProfileRepository');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$site = Phake::mock('OpenOrchestra\ModelInterface\Model\SiteInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event)->getBuilder()->thenReturn($builder);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(2))->setAttribute(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(1))->addModelTransformer(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($builder)->getData()->thenReturn($group);
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($contentTypeRepository)->findAllNotDeletedInLastVersion(Phake::anyParameters())->thenReturn(array($this->contenType));
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($builder)->get(Phake::anyParameters())->thenReturn($builder);
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(2))->setAttribute(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($workflowProfileRepository)->findAll()->thenReturn(array($workflowProfile));
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$event = Phake::mock('OpenOrchestra\GroupBundle\Event\GroupFormEvent');
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($translator)->trans(Phake::anyParameters())->thenReturn('fakeTrans');
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(1))->addModelTransformer(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$workflowProfile = Phake::mock('OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($workflowProfile)->getLabel(\Phake::anyParameters())->thenReturn('fakeWorkflowProfileLabel');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($group)->getSite()->thenReturn($site);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($workflowProfile)->getLabel(\Phake::anyParameters())->thenReturn('fakeWorkflowProfileLabel');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->contenType)->getContentTypeId()->thenReturn('fakeContentTypeId');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($builder)->getAttribute(Phake::anyParameters())->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($builder)->get(Phake::anyParameters())->thenReturn($builder);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(1))->addModelTransformer(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class AddGroupWorkflowProfileSubscriberTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentTypeRepository)->findAllNotDeletedInLastVersion(Phake::anyParameters())->thenReturn(array($this->contenType));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\AddGroupWorkflowProfileSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(GroupFormEvents::GROUP_FORM_CREATION, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(1))->add('workflow_profile_collections', 'oo_check_list_collection', array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->contenType = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$workflowProfileCollectionTransformer = Phake::mock('Symfony\Component\Form\DataTransformerInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$group = Phake::mock('OpenOrchestra\Backoffice\Model\GroupInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($this->contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->contenType)->getName(Phake::anyParameters())->thenReturn('fakeName');
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(1))->add('workflow_profile_collections', 'oo_check_list_collection', array(
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($site)->getContentTypes()->thenReturn(array($this->contenType));
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($translator)->trans(Phake::anyParameters())->thenReturn('fakeTrans');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\AddGroupWorkflowProfileSubscriberTest::assertInstanceOf
Open
$this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$builder = Phake::mock('Symfony\Component\Form\FormBuilderInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(2))->setAttribute(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$translator = Phake::mock('Symfony\Component\Translation\TranslatorInterface');
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $workflowProfileRepository. Keep variable name length under 20. Open
$workflowProfileRepository = Phake::mock('OpenOrchestra\ModelBundle\Repository\WorkflowProfileRepository');
- 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 $workflowProfileCollectionTransformer. Keep variable name length under 20. Open
$workflowProfileCollectionTransformer = Phake::mock('Symfony\Component\Form\DataTransformerInterface');
- 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 $contentTypeRepository. Keep variable name length under 20. Open
$contentTypeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface');
- 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
Phake::when($contentTypeRepository)->findAllNotDeletedInLastVersion(Phake::anyParameters())->thenReturn(array($this->contenType));
- Create a ticketCreate a ticket
- Exclude checks