for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Smalot\Github\Webhook\Event;
use Smalot\Github\Webhook\Model\ModelBase;
use Symfony\Component\EventDispatcher\Event;
/**
* Class EventBase
* @package Smalot\Github\Webhook\Event
*/
abstract class EventBase extends Event
{
* @var string
protected $eventName;
protected $payload;
* @var ModelBase
protected $model;
protected $delivery;
* EventBase constructor.
* @param string $eventName
* @param string $payload
* @param string $delivery
public function __construct($eventName, $payload, $delivery = null)
$this->eventName = $eventName;
$this->payload = (array) json_decode($payload, true);
(array) json_decode($payload, true)
array
string
$payload
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->delivery = $delivery;
$payload = json_decode($this->payload, true);
$className = $this->getClassModel();
$this->model = new $className($payload);
}
* @return string
public function getEventName()
return $this->eventName;
public function getPayload()
return $this->payload;
* @return ModelBase
public function getModel()
return $this->model;
abstract protected function getClassModel();
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..