original_string: public function params(array $params = null) {
          $params = (array)$params;
  
          foreach ($params as $key => $value) {
              if (is_int($key)) {
                  throw new coding_exception('Url parameters can not have numeric keys!');
              }
              if (!is_string($value)) {
                  if (is_array($value)) {
                      throw new coding_exception('Url parameters values can not be arrays!');
                  }
                  if (is_object($value) and !method_exists($value, '__toString')) {
                      throw new coding_exception('Url parameters values can not be objects, unless __toString() is defined!');
                  }
              }
              $this->params[$key] = (string)$value;
          }
          return $this->params;
      }
code: public function params(array $params = null) {
          $params = (array)$params;
  
          foreach ($params as $key => $value) {
              if (is_int($key)) {
                  throw new coding_exception('Url parameters can not have numeric keys!');
              }
              if (!is_string($value)) {
                  if (is_array($value)) {
                      throw new coding_exception('Url parameters values can not be arrays!');
                  }
                  if (is_object($value) and !method_exists($value, '__toString')) {
                      throw new coding_exception('Url parameters values can not be objects, unless __toString() is defined!');
                  }
              }
              $this->params[$key] = (string)$value;
          }
          return $this->params;
      }
code_tokens: public function params ( array $ params = null ) { $ params = ( array ) $ params ; foreach ( $ params as $ key => $ value ) { if ( is_int ( $ key ) ) { throw new coding_exception ( 'Url parameters can not have numeric keys!' ) ; } if ( ! is_string ( $ value ) ) { if ( is_array ( $ value ) ) { throw new coding_exception ( 'Url parameters values can not be arrays!' ) ; } if ( is_object ( $ value ) and ! method_exists ( $ value , '__toString' ) ) { throw new coding_exception ( 'Url parameters values can not be objects, unless __toString() is defined!' ) ; } } $ this -> params [ $ key ] = ( string ) $ value ; } return $ this -> params ; }
docstring: Add an array of params to the params for this url.
  
  The added params override existing ones if they have the same name.
  
  @param array $params Defaults to null. If null then returns all params.
  @return array Array of Params for url.
  @throws coding_exception
docstring_tokens: Add an array of params to the params for this url .