public function __construct(&$target, $name) { if (is_string($target)) { $className = $target; parent::__construct($className); } else { if (!is_array($target) && !is_object($target)) { throw new InvalidArgumentException('Property target must be an array or object.'); } else { parent::__construct($target); } } $this->_name = $name; }
public function __construct(IEventDispatcher $dispatcher, string $eventType = null) { parent::__construct($dispatcher); $this->_eventType = is_null($eventType) ? self::EVENT_TYPE : $eventType; }