public function setDefaults(array $defaults): self
    {
        foreach ((array)$defaults as $key => $value) {
            if (isset($this->defaults[$key])) {
                $this->defaults[$key] = $value;
            } else {
                throw new Exception('Invalid route default', Exception::HTTP_INTERNAL_SERVER_ERROR);
            }
        }

        return $this;
    }
public function setDefaults(array $defaults): self
    {
        foreach ((array)$defaults as $key => $value) {
            if (isset($this->defaults[$key])) {
                $this->defaults[$key] = $value;
            } else {
                throw new Exception('Invalid route default', Exception::HTTP_INTERNAL_SERVER_ERROR);
            }
        }

        return $this;
    }
public function setDefaults ( array $ defaults ) : self { foreach ( ( array ) $ defaults as $ key => $ value ) { if ( isset ( $ this -> defaults [ $ key ] ) ) { $ this -> defaults [ $ key ] = $ value ; } else { throw new Exception ( 'Invalid route default' , Exception :: HTTP_INTERNAL_SERVER_ERROR ) ; } } return $ this ; }
Set route defaults

@param array $defaults
@throws \Janeiro\Mvc\Exception
@return self
Set route defaults