HippoPHP\Hippo\HippoTextUIContext::getAction PHP Method

getAction() public method

public getAction ( ) : integer
return integer
    public function getAction()
    {
        return $this->action;
    }

Usage Example

Example #1
0
 protected function run()
 {
     switch ($this->context->getAction()) {
         case HippoTextUIContext::ACTION_HELP:
             $this->showHelp();
             $this->environment->setExitCode(0);
             $this->environment->shutdown();
             break;
         case HippoTextUIContext::ACTION_VERSION:
             $this->showVersion();
             $this->environment->setExitCode(0);
             $this->environment->shutdown();
             break;
         case HippoTextUIContext::ACTION_CHECK:
             $this->runChecks();
             break;
         default:
             throw new Exception('Unrecognized action');
     }
 }