public function getRulesFor(Symbol $subject): array
    {
        $rules = [];
        if (!$subject->isTerminal()) {
            foreach ($this->rules as $rule) {
                if (0 === Symbol::compare($rule->getSubject(), $subject)) {
                    $rules[] = $rule;
                }
            }
        }
        return $rules;
    }
public function getRulesFor(Symbol $subject): array
    {
        $rules = [];
        if (!$subject->isTerminal()) {
            foreach ($this->rules as $rule) {
                if (0 === Symbol::compare($rule->getSubject(), $subject)) {
                    $rules[] = $rule;
                }
            }
        }
        return $rules;
    }
public function getRulesFor ( Symbol $ subject ) : array { $ rules = [ ] ; if ( ! $ subject -> isTerminal ( ) ) { foreach ( $ this -> rules as $ rule ) { if ( 0 === Symbol :: compare ( $ rule -> getSubject ( ) , $ subject ) ) { $ rules [ ] = $ rule ; } } } return $ rules ; }
Get rules defining a subject Symbol
@param Symbol $subject Symbol to search
@return Rule[]
Get rules defining a subject Symbol