Avoid using static access to class '\Phake' in method 'testBuildForm'. Open
Phake::verify($builder)->addEventSubscriber(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 'testBuildForm'. 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
$this->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 'setUp'. Open
$this->contentRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface');
- 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 'testBuildForm'. Open
Phake::verify($builder, Phake::times(3))->add(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 'testBuildForm'. Open
Phake::verify($builder, Phake::times(3))->add(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
$booleanConditionValidator = Phake::mock('OpenOrchestra\Backoffice\Validator\Constraints\BooleanConditionValidator');
- 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
$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(3))->add(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::verify($builder)->addEventSubscriber(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\ContentSearchTypeTest::assertInstanceOf
Open
$this->assertInstanceOf('Symfony\Component\Form\AbstractType', $this->form);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->contentRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\ContentRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->contextManager = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$booleanConditionValidator = Phake::mock('OpenOrchestra\Backoffice\Validator\Constraints\BooleanConditionValidator');
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(3))->add(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder)->addEventSubscriber(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class ContentSearchTypeTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder, Phake::times(3))->add(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\Form\Type\Component\ContentSearchTypeTest::assertEquals
Open
$this->assertEquals('oo_content_search', $this->form->getName());
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $booleanConditionValidator. Keep variable name length under 20. Open
$booleanConditionValidator = Phake::mock('OpenOrchestra\Backoffice\Validator\Constraints\BooleanConditionValidator');
- 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
The closing brace for the class must go on the next line after the body Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$booleanConditionValidator = Phake::mock('OpenOrchestra\Backoffice\Validator\Constraints\BooleanConditionValidator');
- Create a ticketCreate a ticket
- Exclude checks