public function withAction(string $actionName)
    {
        if (!isset($this->actions[$actionName])) {
            throw InvalidArgumentException::format(
                'Invalid action name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->actions)), $actionName
            );
        }

        call_user_func($this->callback, new ActionWidget($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->actions[$actionName]));
    }
public function withAction(string $actionName)
    {
        if (!isset($this->actions[$actionName])) {
            throw InvalidArgumentException::format(
                'Invalid action name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->actions)), $actionName
            );
        }

        call_user_func($this->callback, new ActionWidget($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->actions[$actionName]));
    }
public function withAction ( string $ actionName ) { if ( ! isset ( $ this -> actions [ $ actionName ] ) ) { throw InvalidArgumentException :: format ( 'Invalid action name supplied to %s: expecting one of (%s), \'%s\' given' , __METHOD__ , Debug :: formatValues ( array_keys ( $ this -> actions ) ) , $ actionName ) ; } call_user_func ( $ this -> callback , new ActionWidget ( $ this -> name , $ this -> label , $ this -> authSystem , $ this -> requiredPermissions , $ this -> actions [ $ actionName ] ) ) ; }
Defines the widget to contain an action from the module.

@param string $actionName

@return void
@throws InvalidArgumentException
Defines the widget to contain an action from the module .