. */ namespace SP\Services; use DI\Container; use Psr\Container\ContainerInterface; use SP\Config\Config; use SP\Core\Events\EventDispatcher; use SP\Core\Session\Session; /** * Class Service * * @package SP\Services */ abstract class Service { const STATUS_INTERNAL_ERROR = 1000; /** * @var Config */ protected $config; /** * @var Session */ protected $session; /** * @var EventDispatcher */ protected $eventDispatcher; /** * @var ContainerInterface */ protected $dic; /** * Service constructor. * * @param Container $dic * @param Config $config * @param Session $session * @param EventDispatcher $eventDispatcher */ final public function __construct(Container $dic, Config $config, Session $session, EventDispatcher $eventDispatcher) { $this->dic = $dic; $this->config = $config; $this->session = $session; $this->eventDispatcher = $eventDispatcher; if (method_exists($this, 'initialize')) { $this->initialize(); } } }