protected function configureHook(Config\Hook $config, array $json) : void
    {
        $config->setEnabled($json['enabled']);
        foreach ($json['actions'] as $actionJson) {
            $options    = isset($actionJson['options']) && is_array($actionJson['options'])
                        ? $actionJson['options']
                        : [];
            $conditions = isset($actionJson['conditions']) && is_array($actionJson['conditions'])
                        ? $actionJson['conditions']
                        : [];
            $config->addAction(new Config\Action($actionJson['action'], $options, $conditions));
        }
    }
protected function configureHook(Config\Hook $config, array $json) : void
    {
        $config->setEnabled($json['enabled']);
        foreach ($json['actions'] as $actionJson) {
            $options    = isset($actionJson['options']) && is_array($actionJson['options'])
                        ? $actionJson['options']
                        : [];
            $conditions = isset($actionJson['conditions']) && is_array($actionJson['conditions'])
                        ? $actionJson['conditions']
                        : [];
            $config->addAction(new Config\Action($actionJson['action'], $options, $conditions));
        }
    }
protected function configureHook ( Config \ Hook $ config , array $ json ) : void { $ config -> setEnabled ( $ json [ 'enabled' ] ) ; foreach ( $ json [ 'actions' ] as $ actionJson ) { $ options = isset ( $ actionJson [ 'options' ] ) && is_array ( $ actionJson [ 'options' ] ) ? $ actionJson [ 'options' ] : [ ] ; $ conditions = isset ( $ actionJson [ 'conditions' ] ) && is_array ( $ actionJson [ 'conditions' ] ) ? $ actionJson [ 'conditions' ] : [ ] ; $ config -> addAction ( new Config \ Action ( $ actionJson [ 'action' ] , $ options , $ conditions ) ) ; } }
Setup a hook configuration by json data

@param  \CaptainHook\App\Config\Hook $config
@param  array                        $json
@return void
@throws \Exception
Setup a hook configuration by json data