for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace T4web\DomainModule;
use Zend\EventManager\EventManager;
use T4webDomainInterface\EventManagerInterface;
use T4webDomainInterface\EventInterface;
use T4webDomainInterface\EntityInterface;
class EntityEventManager implements EventManagerInterface
{
/**
* @var EventManager
*/
private $eventManager;
* EntityEventManager constructor.
* @param EventManager $eventManager
public function __construct(EventManager $eventManager)
$this->eventManager = $eventManager;
}
* @param EventInterface $event
public function trigger(EventInterface $event)
$this->eventManager->triggerEvent($event);
$event
object<T4webDomainInterface\EventInterface>
object<Zend\EventManager\EventInterface>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
* @param $event
* @param $listener
public function attach($event, $listener = null)
$this->eventManager->attach($event, $listener);
$listener
null
callable
* @param EntityInterface|null $entity
* @param array $data
* @return EntityEvent
public function createEvent($event, EntityInterface $entity = null, array $data = [])
return new EntityEvent($event, $entity, $data);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: