Method provideEvent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideEvent()
{
$formData0 = new ArrayCollection(array(
'order0' => true,
'order1' => true,
- Create a ticketCreate a ticket
Avoid using static access to class '\Phake' in method 'testPreSubmit'. Open
$config = Phake::mock('Symfony\Component\Form\FormConfigInterface');
- 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 'testPreSubmit'. Open
$event = Phake::mock('Symfony\Component\Form\FormEvent');
- 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 'testPreSubmit'. Open
$eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- 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
$event = Phake::mock('Symfony\Component\Form\FormEvent');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event)->getData()->thenReturn($data);
- Create a ticketCreate a ticket
- Exclude checks
Possibly zero references to use statement for classlike/namespace FormEvent
(\Symfony\Component\Form\FormEvent)
Open
use Symfony\Component\Form\FormEvent;
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class SortableCollectionSubscriberTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($config)->getModelTransformers()->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event)->getForm()->thenReturn($form);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$eventDispatcher = Phake::mock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getData
from undeclared class \Symfony\Component\Form\Form
Open
$newData = $form->getData();
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($config)->getEventDispatcher()->thenReturn($eventDispatcher);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$config = Phake::mock('Symfony\Component\Form\FormConfigInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setData
from undeclared class \Symfony\Component\Form\Form
Open
$form->setData($formData);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\SortableCollectionSubscriberTest::assertInstanceOf
Open
$this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant PRE_SUBMIT
from undeclared class \Symfony\Component\Form\FormEvents
Open
$this->assertArrayHasKey(FormEvents::PRE_SUBMIT, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\SortableCollectionSubscriberTest::assertEquals
Open
$this->assertEquals($expectedOrder, array_keys($newData));
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \Symfony\Component\Form\Form
Open
$form = new Form($config);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \Doctrine\Common\Collections\ArrayCollection
Open
$formData0 = new ArrayCollection(array(
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\SortableCollectionSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(FormEvents::PRE_SUBMIT, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
$data1 = array(
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
));
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
return array(
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
$expectedOrder = array(
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
);
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
);
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
);
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
);
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
$data0 = array(
- Create a ticketCreate a ticket
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 7 Open
);
- Create a ticketCreate a ticket
- Exclude checks