public function withRules(array $rules): self
    {
        $new = clone $this;
        /* Clear the stack */
        unset($new->rules);
        $new->rules = new \SplStack;
        /* Add the rules */
        foreach ($rules as $callable) {
            $new = $new->addRule($callable);
        }
        return $new;
    }
public function withRules(array $rules): self
    {
        $new = clone $this;
        /* Clear the stack */
        unset($new->rules);
        $new->rules = new \SplStack;
        /* Add the rules */
        foreach ($rules as $callable) {
            $new = $new->addRule($callable);
        }
        return $new;
    }
public function withRules ( array $ rules ) : self { $ new = clone $ this ; /* Clear the stack */ unset ( $ new -> rules ) ; $ new -> rules = new \ SplStack ; /* Add the rules */ foreach ( $ rules as $ callable ) { $ new = $ new -> addRule ( $ callable ) ; } return $ new ; }
Set all rules in the stack.
Set all rules in the stack .