Permalink
Browse files

Renamned deluded option key.

  • Loading branch information...
1 parent 45a96db commit ae2f0dfd8b1a8e6b3a565c14e332f689a463d8c6 Anton Lindqvist committed Mar 15, 2011
Showing with 7 additions and 7 deletions.
  1. +2 −2 README.md
  2. +2 −2 Uri.php
  3. +3 −3 tests/Uri_Test.php
View
@@ -63,10 +63,10 @@ Foo::bar((string)$uri);</code></pre>
</thead>
<tbody>
<tr>
- <td>decode</td>
+ <td>encode</td>
<td>boolean</td>
<td>false</td>
- <td>Decode the URI.</td>
+ <td>Encode the URI.</td>
</tr>
<tr>
<td>hash</td>
View
@@ -82,7 +82,7 @@ class Uri {
* @var array
*/
private static $_defaultOptions = array(
- 'decode' => false,
+ 'encode' => false,
'hash' => null,
'parameters' => null,
'password' => null,
@@ -169,7 +169,7 @@ public function __toString() {
$uri .= ($this->hash)
? '#' . http_build_query($this->hash, '', $this->_options['separator'])
: '';
- $uri = ($this->_options['decode']) ? urlencode($uri) : $uri;
+ $uri = ($this->_options['encode']) ? urlencode($uri) : $uri;
return $uri;
}
View
@@ -21,8 +21,8 @@ function testMultiplePaths() {
self::assertEquals('http://www.example.com/blog/first-post', (string)$uri);
}
- function testDecode() {
- $uri = new Uri('www.example.com', 'blog', array('decode' => true));
+ function testEncode() {
+ $uri = new Uri('www.example.com', 'blog', array('encode' => true));
self::assertEquals('http%3A%2F%2Fwww.example.com%2Fblog', (string)$uri);
}
@@ -162,7 +162,7 @@ function testAllOptions() {
'www.example.com',
array('blog', 'second-post'),
array(
- 'decode' => true,
+ 'encode' => true,
'hash' => array('foo' => 'bar', 'bar' => 'foo', 'foobar' => 1337),
'parameters' => array('bar' => 'foo', 'foo' => 'bar', 'foobar' => 1337),
'username' => 'admin',

0 comments on commit ae2f0df

Please sign in to comment.