Avoid using static access to class '\Phake' in method 'testBuildView'. Open
$view = Phake::mock('Symfony\Component\Form\FormView');
- 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 'generateStatus'. Open
Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);
- 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->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');
- 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 'generateStatus'. Open
$status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- 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 'testConfigureOptions'. Open
$resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');
- 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 'testBuildView'. Open
$form = Phake::mock('Symfony\Component\Form\FormInterface');
- 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
$view = Phake::mock('Symfony\Component\Form\FormView');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$form = Phake::mock('Symfony\Component\Form\FormInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$status = Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open
$this->assertSame($expected, $view->vars['statuses']);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status)->getId()->thenReturn($statusId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open
$this->assertSame('choice', $this->form->getParent());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::assertSame
Open
$this->assertSame('oo_workflow_transitions_collection', $this->form->getName());
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::when($status)->getLabel(Phake::anyParameters())->thenReturn('label-' . $statusId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($builder)->addModelTransformer($this->transitionTransformer);
- 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 undeclared method \OpenOrchestra\Workflow\Tests\Form\Type\Component\WorkflowTransitionsCollectionTypeTest::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
$resolver = Phake::mock('Symfony\Component\OptionsResolver\OptionsResolver');
- Create a ticketCreate a ticket
- Exclude checks
Return type of generateStatus()
is undeclared type \OpenOrchestra\Workflow\Tests\Form\Type\Component\Phake_IMock
Open
protected function generateStatus($statusId)
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class WorkflowTransitionsCollectionTypeTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($resolver)->setDefaults(array(
- Create a ticketCreate a ticket
- Exclude checks
Avoid excessively long variable names like $transitionTransformer. Keep variable name length under 20. Open
protected $transitionTransformer;
- 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 128 characters Open
$this->transitionTransformer = Phake::mock('OpenOrchestra\Workflow\Form\DataTransformer\ProfileTransitionsTransformer');
- Create a ticketCreate a ticket
- Exclude checks