Method provideEvent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideEvent()
{
$event0 = Phake::mock('Symfony\Component\Form\FormEvent');
$form0 = Phake::mock('Symfony\Component\Form\FormInterface');
$contentType0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');
- Create a ticketCreate a ticket
Missing class import via use statement (line '99', column '56'). Open
Phake::when($form2)->getData()->thenReturn(new \stdClass());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\Phake' in method 'testPreSubmit'. Open
Phake::verify($this->statusRepository, Phake::times($isInitial))->findOneByInitial();
- 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->statusRepository)->findOneByOutOfWorkflow()->thenReturn(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 'provideEvent'. Open
$form0 = 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
Avoid using static access to class '\Phake' in method 'provideEvent'. Open
$event2 = 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 'provideEvent'. Open
$contentType0 = 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 'provideEvent'. Open
$event1 = 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 '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 'setUp'. Open
$this->statusRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface');
- 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->statusRepository)->findOneByInitial()->thenReturn(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 'testPreSubmit'. Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(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 'provideEvent'. Open
$event0 = 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 'provideEvent'. Open
$contentType1 = 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 'testPreSubmit'. Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(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 'provideEvent'. Open
$form1 = 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
Avoid using static access to class '\Phake' in method 'provideEvent'. Open
$form2 = 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
Avoid using static access to class '\Phake' in method 'testPreSubmit'. Open
Phake::verify($this->statusRepository, Phake::times($isOutOfWorkflow))->findOneByOutOfWorkflow();
- 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
$form0 = Phake::mock('Symfony\Component\Form\FormInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event2)->getData()->thenReturn(array());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->statusRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\StatusRepositoryInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->statusRepository)->findOneByInitial()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event1)->getForm()->thenReturn($form1);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event1)->getData()->thenReturn(array('definingStatusable' => 0));
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeStatusableSubscriberTest::assertInstanceOf
Open
$this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event2)->getForm()->thenReturn($form2);
- 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 undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\ContentTypeStatusableSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(FormEvents::PRE_SUBMIT, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method anyParameters
from undeclared class \Phake
Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event0)->getForm()->thenReturn($form0);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentType1 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$event2 = Phake::mock('Symfony\Component\Form\FormEvent');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$event0 = Phake::mock('Symfony\Component\Form\FormEvent');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($event0)->getData()->thenReturn(array('definingStatusable' => 1));
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$event1 = Phake::mock('Symfony\Component\Form\FormEvent');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->statusRepository)->findOneByOutOfWorkflow()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($form0)->getData()->thenReturn($contentType0);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($form2)->getData()->thenReturn(new \stdClass());
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class ContentTypeStatusableSubscriberTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
Phake::when($this->statusRepository)->findOneByInitial()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$form1 = Phake::mock('Symfony\Component\Form\FormInterface');
- Create a ticketCreate a ticket
- Exclude checks
Saw an @param annotation for isUdpated,
but it was not found in the param list of function testPreSubmit(\Symfony\Component\Form\FormEvent $event, int $isInitial, int $isOutOfWorkflow, $isUpdated)
Open
* @param int $isUdpated
- Create a ticketCreate a ticket
- Exclude checks
Parameter $event
has undeclared type \Symfony\Component\Form\FormEvent
Open
public function testPreSubmit(FormEvent $event, $isInitial, $isOutOfWorkflow, $isUpdated)
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($this->statusRepository, Phake::times($isOutOfWorkflow))->findOneByOutOfWorkflow();
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentType0)->isDefiningStatusable()->thenReturn(false);
- Create a ticketCreate a ticket
- Exclude checks
Call to method times
from undeclared class \Phake
Open
Phake::verify($this->statusRepository, Phake::times($isInitial))->findOneByInitial();
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentType0 = Phake::mock('OpenOrchestra\ModelInterface\Model\ContentTypeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentType0)->getContentTypeId()->thenReturn('fakeContentTypeId');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentType1)->isDefiningStatusable()->thenReturn(true);
- 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 method verify
from undeclared class \Phake
Open
Phake::verify($this->statusRepository, Phake::times($isInitial))->findOneByInitial();
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($form1)->getData()->thenReturn($contentType1);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->statusRepository, Phake::times($isOutOfWorkflow))->findOneByOutOfWorkflow();
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$form2 = Phake::mock('Symfony\Component\Form\FormInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
Phake::when($this->statusRepository)->findOneByOutOfWorkflow()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentType1)->getContentTypeId()->thenReturn('fakeContentTypeId');
- Create a ticketCreate a ticket
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
Phake::when($this->statusRepository)->findOneByInitial()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
Phake::verify($this->contentRepository, Phake::times($isUpdated))->updateStatusByContentType(Phake::anyParameters());
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
Phake::when($this->statusRepository)->findOneByOutOfWorkflow()->thenReturn(Phake::mock('OpenOrchestra\ModelInterface\Model\StatusInterface'));
- Create a ticketCreate a ticket
- Exclude checks