. */ namespace SP\Core; use SP\Config\Config; use SP\Core\Context\ContextInterface; use SP\Core\Events\EventDispatcher; /** * The Application helper class. It holds all the needed dependencies for the application */ final class Application { private Config $config; private EventDispatcher $eventDispatcher; private ContextInterface $context; /** * Module constructor. * * @param \SP\Config\Config $config * @param \SP\Core\Events\EventDispatcher $eventDispatcher * @param \SP\Core\Context\ContextInterface $context */ public function __construct( Config $config, EventDispatcher $eventDispatcher, ContextInterface $context ) { $this->config = $config; $this->eventDispatcher = $eventDispatcher; $this->context = $context; } /** * @return \SP\Config\Config */ public function getConfig(): Config { return $this->config; } /** * @return \SP\Core\Events\EventDispatcher */ public function getEventDispatcher(): EventDispatcher { return $this->eventDispatcher; } /** * @return \SP\Core\Context\ContextInterface */ public function getContext(): ContextInterface { return $this->context; } }