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