public function run() : void
    {
        /** @var \CaptainHook\App\Config\Hook $hookConfig */
        $hookConfig = $this->config->getHookConfig($this->hook);
        $actions    = $hookConfig->getActions();

        // if hook is not enabled in captainhook configuration skip the execution
        if (!$hookConfig->isEnabled()) {
            $this->io->write($this->formatHookHeadline('Skip'));
            return;
        }
        // if no actions are configured do nothing
        if (count($actions) === 0) {
            $this->io->write(['', '<info>No actions to execute</info>']);
            return;
        }

        $this->io->write($this->formatHookHeadline('Execute'));
        $this->beforeHook();
        foreach ($actions as $action) {
            $this->handleAction($action);
        }
        $this->afterHook();
    }
public function run() : void
    {
        /** @var \CaptainHook\App\Config\Hook $hookConfig */
        $hookConfig = $this->config->getHookConfig($this->hook);
        $actions    = $hookConfig->getActions();

        // if hook is not enabled in captainhook configuration skip the execution
        if (!$hookConfig->isEnabled()) {
            $this->io->write($this->formatHookHeadline('Skip'));
            return;
        }
        // if no actions are configured do nothing
        if (count($actions) === 0) {
            $this->io->write(['', '<info>No actions to execute</info>']);
            return;
        }

        $this->io->write($this->formatHookHeadline('Execute'));
        $this->beforeHook();
        foreach ($actions as $action) {
            $this->handleAction($action);
        }
        $this->afterHook();
    }
public function run ( ) : void { /** @var \CaptainHook\App\Config\Hook $hookConfig */ $ hookConfig = $ this -> config -> getHookConfig ( $ this -> hook ) ; $ actions = $ hookConfig -> getActions ( ) ; // if hook is not enabled in captainhook configuration skip the execution if ( ! $ hookConfig -> isEnabled ( ) ) { $ this -> io -> write ( $ this -> formatHookHeadline ( 'Skip' ) ) ; return ; } // if no actions are configured do nothing if ( count ( $ actions ) === 0 ) { $ this -> io -> write ( [ '' , '<info>No actions to execute</info>' ] ) ; return ; } $ this -> io -> write ( $ this -> formatHookHeadline ( 'Execute' ) ) ; $ this -> beforeHook ( ) ; foreach ( $ actions as $ action ) { $ this -> handleAction ( $ action ) ; } $ this -> afterHook ( ) ; }
Execute the hook and all its actions

@return void
@throws \Exception
Execute the hook and all its actions