Avoid using static access to class '\Phake' in method 'setUp'. Open
$this->contentTypeEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\ContentTypeEvent');
- 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->contentType = Phake::mock('OpenOrchestra\ModelBundle\Document\ContentType');
- 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->context = 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
Call to method when
from undeclared class \Phake
Open
Phake::when($this->context)->getBackOfficeLanguage()->thenReturn($this->locale);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_TYPE_CREATE
from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open
array(ContentTypeEvents::CONTENT_TYPE_CREATE),
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->contentType = Phake::mock('OpenOrchestra\ModelBundle\Document\ContentType');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_TYPE_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open
array(ContentTypeEvents::CONTENT_TYPE_UPDATE),
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->context = Phake::mock('OpenOrchestra\Backoffice\Context\ContextBackOfficeInterface');
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($this->contentTypeEvent)->getContentType()->thenReturn($this->contentType);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->contentTypeEvent = Phake::mock('OpenOrchestra\ModelInterface\Event\ContentTypeEvent');
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_TYPE_DELETE
from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open
array(ContentTypeEvents::CONTENT_TYPE_DELETE),
- Create a ticketCreate a ticket
- Exclude checks