The class UpdateReferenceSubscriberTest has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13. Open
class UpdateReferenceSubscriberTest extends AbstractBaseTestCase
{
/**
* @var UpdateReferenceSubscriber
*/
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Avoid using static access to class '\Phake' in method 'testUpdateReferencesToContentType'. Open
$contentType = Phake::mock(ContentTypeInterface::class);
- 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 'testUpdateReferencesToContentType'. Open
$contentTypeEvent = Phake::mock(ContentTypeEvent::class);
- 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 'testUpdateReferencesToNode'. Open
$node = Phake::mock(NodeInterface::class);
- 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 'testUpdateReferencesToNode'. Open
$nodeEvent = Phake::mock(NodeEvent::class);
- 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 'testUpdateReferencesToBlock'. Open
$blockEvent = Phake::mock(BlockEvent::class);
- 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 'testUpdateReferencesToContent'. Open
$content = Phake::mock(ContentInterface::class);
- 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 'testRemoveReferencesToBlock'. Open
$blockEvent = Phake::mock(BlockEvent::class);
- 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->referenceManager = Phake::mock(ReferenceManager::class);
- 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 'testUpdateReferencesToContent'. Open
$contentEvent = Phake::mock(ContentEvent::class);
- 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 'testRemoveReferencesToEntity'. Open
$deletedEntity = Phake::mock(SoftDeleteableInterface::class);
- 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 'testRemoveReferencesToBlock'. Open
$block = Phake::mock(ReadBlockInterface::class);
- 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 'testRemoveReferencesToEntity'. Open
$trashcanEvent = Phake::mock(TrashcanEvent::class);
- 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 'testUpdateReferencesToBlock'. Open
$block = Phake::mock(ReadBlockInterface::class);
- 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
Reference to constant CONTENT_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_CREATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_CREATION
from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_CREATION, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_DUPLICATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$this->referenceManager = Phake::mock(ReferenceManager::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant NODE_CREATION
from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open
$this->assertArrayHasKey(NodeEvents::NODE_CREATION, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(NodeEvents::NODE_CREATION, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$blockEvent = Phake::mock(BlockEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\ContentTypeEvent
Open
$contentTypeEvent = Phake::mock(ContentTypeEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_CREATION, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$deletedEntity = Phake::mock(SoftDeleteableInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_DUPLICATE
from undeclared class \OpenOrchestra\ModelInterface\ContentEvents
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_DUPLICATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\TrashcanEvent
Open
$trashcanEvent = Phake::mock(TrashcanEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant POST_BLOCK_CREATE
from undeclared class \OpenOrchestra\ModelInterface\BlockEvents
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_CREATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($blockEvent)->getBlock()->thenReturn($block);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\ReadBlockInterface
Open
$block = Phake::mock(ReadBlockInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentEvent)->getContent()->thenReturn($content);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$nodeEvent = Phake::mock(NodeEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Class extends undeclared class \OpenOrchestra\BaseBundle\Tests\AbstractTest\AbstractBaseTestCase
Open
class UpdateReferenceSubscriberTest extends AbstractBaseTestCase
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$block = Phake::mock(ReadBlockInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$content = Phake::mock(ContentInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($contentTypeEvent)->getContentType()->thenReturn($contentType);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_TYPE_CREATE
from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open
$this->assertArrayHasKey(ContentTypeEvents::CONTENT_TYPE_CREATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\NodeEvent
Open
$nodeEvent = Phake::mock(NodeEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->updateReferencesToEntity($contentType);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$trashcanEvent = Phake::mock(TrashcanEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertInstanceOf
Open
$this->assertInstanceOf('Symfony\Component\EventDispatcher\EventSubscriberInterface', $this->subscriber);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(ContentEvents::CONTENT_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant NODE_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\NodeEvents
Open
$this->assertArrayHasKey(NodeEvents::NODE_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\BlockEvent
Open
$blockEvent = Phake::mock(BlockEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentInterface
Open
$content = Phake::mock(ContentInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->updateReferencesToEntity($content);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\BlockEvent
Open
$blockEvent = Phake::mock(BlockEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->removeReferencesToEntity($deletedEntity);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$block = Phake::mock(ReadBlockInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentType = Phake::mock(ContentTypeInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($trashcanEvent)->getDeletedEntity()->thenReturn($deletedEntity);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant CONTENT_TYPE_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\ContentTypeEvents
Open
$this->assertArrayHasKey(ContentTypeEvents::CONTENT_TYPE_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(ContentTypeEvents::CONTENT_TYPE_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Event\ContentEvent
Open
$contentEvent = Phake::mock(ContentEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\ContentTypeInterface
Open
$contentType = Phake::mock(ContentTypeInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant POST_BLOCK_UPDATE
from undeclared class \OpenOrchestra\ModelInterface\BlockEvents
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant POST_BLOCK_DELETE
from undeclared class \OpenOrchestra\ModelInterface\BlockEvents
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_DELETE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_DELETE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(NodeEvents::NODE_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(TrashcanEvents::TRASHCAN_REMOVE_ENTITY, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($blockEvent)->getBlock()->thenReturn($block);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->updateReferencesToEntity($block);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentEvent = Phake::mock(ContentEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$node = Phake::mock(NodeInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->updateReferencesToEntity($node);
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\ReadBlockInterface
Open
$block = Phake::mock(ReadBlockInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(BlockEvents::POST_BLOCK_UPDATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\NodeInterface
Open
$node = Phake::mock(NodeInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method when
from undeclared class \Phake
Open
Phake::when($nodeEvent)->getNode()->thenReturn($node);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$blockEvent = Phake::mock(BlockEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared method \OpenOrchestra\Backoffice\Tests\EventSubscriber\UpdateReferenceSubscriberTest::assertArrayHasKey
Open
$this->assertArrayHasKey(ContentTypeEvents::CONTENT_TYPE_CREATE, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant TRASHCAN_REMOVE_ENTITY
from undeclared class \OpenOrchestra\ModelInterface\TrashcanEvents
Open
$this->assertArrayHasKey(TrashcanEvents::TRASHCAN_REMOVE_ENTITY, $this->subscriber->getSubscribedEvents());
- Create a ticketCreate a ticket
- Exclude checks
Reference to constant class
from undeclared class \OpenOrchestra\ModelInterface\Model\SoftDeleteableInterface
Open
$deletedEntity = Phake::mock(SoftDeleteableInterface::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method mock
from undeclared class \Phake
Open
$contentTypeEvent = Phake::mock(ContentTypeEvent::class);
- Create a ticketCreate a ticket
- Exclude checks
Call to method verify
from undeclared class \Phake
Open
Phake::verify($this->referenceManager)->removeReferencesToEntity($block);
- 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