protected function filterDetectedRules(array $rules, AppliesToResource $resource)
    {

        if (!$this->typeProvider) {
            return $rules;
        }

        $filteredRules = [];

        foreach ($rules as $key=>$rule) {

            if (!$type = $this->xType($key)) {
                continue;
            }

            if ($this->shouldRemoveRules($key, $type)) {
                continue;
            }

            if ($type->readonly) {
                $filteredRules[$key] = 'forbidden';
                continue;
            }

            $filteredRules[$key] = $rule;
        }

        return $filteredRules;
    }
protected function filterDetectedRules(array $rules, AppliesToResource $resource)
    {

        if (!$this->typeProvider) {
            return $rules;
        }

        $filteredRules = [];

        foreach ($rules as $key=>$rule) {

            if (!$type = $this->xType($key)) {
                continue;
            }

            if ($this->shouldRemoveRules($key, $type)) {
                continue;
            }

            if ($type->readonly) {
                $filteredRules[$key] = 'forbidden';
                continue;
            }

            $filteredRules[$key] = $rule;
        }

        return $filteredRules;
    }
protected function filterDetectedRules ( array $ rules , AppliesToResource $ resource ) { if ( ! $ this -> typeProvider ) { return $ rules ; } $ filteredRules = [ ] ; foreach ( $ rules as $ key => $ rule ) { if ( ! $ type = $ this -> xType ( $ key ) ) { continue ; } if ( $ this -> shouldRemoveRules ( $ key , $ type ) ) { continue ; } if ( $ type -> readonly ) { $ filteredRules [ $ key ] = 'forbidden' ; continue ; } $ filteredRules [ $ key ] = $ rule ; } return $ filteredRules ; }
Apply some filtering on the detected rules. If they are provided by
a TypeProvider they contain really all keys, also readonly

@param array $rules
@param AppliesToResource $resource

@return array
Apply some filtering on the detected rules . If they are provided by a TypeProvider they contain really all keys also readonly