public function getRules(int $crud = NULL, string $type = NULL): array
    {
        // first pass to match crud filter
        if ($crud == NULL) {
            $ruleSet = $this->rules;
        } else {
            $ruleSet = [];
            foreach ($this->rules as $rule) {
                if ($rule->crud & $crud) {
                    $ruleSet[] = $rule;
                }
            }

        }

        // first pass to match crud filter
        if ($type == NULL) {
            return $ruleSet;
        } else {
            $filteredRuleSet = [];
            foreach ($ruleSet as $rule) {
                $reflection = new \ReflectionClass($rule);
                $className = $reflection->getShortName();
                if ($className == $type) {
                    $filteredRuleSet[] = $rule;
                }
            }
            return $filteredRuleSet;
        }
    }
public function getRules(int $crud = NULL, string $type = NULL): array
    {
        // first pass to match crud filter
        if ($crud == NULL) {
            $ruleSet = $this->rules;
        } else {
            $ruleSet = [];
            foreach ($this->rules as $rule) {
                if ($rule->crud & $crud) {
                    $ruleSet[] = $rule;
                }
            }

        }

        // first pass to match crud filter
        if ($type == NULL) {
            return $ruleSet;
        } else {
            $filteredRuleSet = [];
            foreach ($ruleSet as $rule) {
                $reflection = new \ReflectionClass($rule);
                $className = $reflection->getShortName();
                if ($className == $type) {
                    $filteredRuleSet[] = $rule;
                }
            }
            return $filteredRuleSet;
        }
    }
public function getRules ( int $ crud = NULL , string $ type = NULL ) : array { // first pass to match crud filter if ( $ crud == NULL ) { $ ruleSet = $ this -> rules ; } else { $ ruleSet = [ ] ; foreach ( $ this -> rules as $ rule ) { if ( $ rule -> crud & $ crud ) { $ ruleSet [ ] = $ rule ; } } } // first pass to match crud filter if ( $ type == NULL ) { return $ ruleSet ; } else { $ filteredRuleSet = [ ] ; foreach ( $ ruleSet as $ rule ) { $ reflection = new \ ReflectionClass ( $ rule ) ; $ className = $ reflection -> getShortName ( ) ; if ( $ className == $ type ) { $ filteredRuleSet [ ] = $ rule ; } } return $ filteredRuleSet ; } }
get all rules for the relevant action
If no mode is supplied, all rules are returned

@param int|NULL $crud
@param string|NULL $type
@return array
@throws \ReflectionException
get all rules for the relevant action If no mode is supplied all rules are returned