Gush\Application::__construct PHP Method

__construct() public method

public __construct ( AdapterFactory $adapterFactory, Config $config, $version = '@package_version@' )
$adapterFactory Gush\Factory\AdapterFactory
$config Config
    public function __construct(AdapterFactory $adapterFactory, Config $config, $version = '@package_version@')
    {
        if ('@' . 'package_version@' !== $version) {
            $version = ltrim($version, 'v');
        }
        parent::__construct('Gush', $version);
        $this->adapterFactory = $adapterFactory;
        $this->config = $config;
        // The parent dispatcher is private and has
        // no accessor, so we set it here to make it accessible.
        $this->dispatcher = new EventDispatcher();
        $this->registerSubscribers();
        $this->addCommands($this->getCommands());
    }

Usage Example

Example #1
0
 /**
  * @param AdapterFactory $adapterFactory
  * @param Config         $config
  * @param \Closure       $helperSetManipulator
  */
 public function __construct(AdapterFactory $adapterFactory, Config $config, $helperSetManipulator)
 {
     $this->helperSetManipulator = $helperSetManipulator;
     parent::__construct($adapterFactory, $config, '@package_version@');
 }