Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

request #14979: fluent interface for decorator's setOption() method

git-svn-id: http://svn.php.net/repository/pear/packages/Translation2/trunk@268672 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 1ef6c7533738793d4d356c1eba93ca3fbe7d8292 1 parent e270e3a
@quipo quipo authored
Showing with 10 additions and 7 deletions.
  1. +2 −1  Decorator.php
  2. +3 −3 Decorator/Lang.php
  3. +5 −3 package.xml
View
3  Decorator.php
@@ -125,7 +125,7 @@ function setOptions($options=array())
* @param string $option option name
* @param mixed $value option value
*
- * @return void
+ * @return self
*/
function setOption($option, $value=null)
{
@@ -134,6 +134,7 @@ function setOption($option, $value=null)
} elseif (is_a($this->translation2, 'Translation2_Decorator')) {
$this->translation2->setOption($option, $value);
}
+ return $this;
}
// }}}
View
6 Decorator/Lang.php
@@ -73,15 +73,15 @@ class Translation2_Decorator_Lang extends Translation2_Decorator
* @param string $option option name
* @param mixed $value option value
*
- * @return void
+ * @return self
*/
function setOption($option, $value=null)
{
if ($option == 'fallbackLang') {
$this->fallbackLang = $value;
- } else {
- parent::setOption($option, $value);
+ return $this;
}
+ return parent::setOption($option, $value);
}
// }}}
View
8 package.xml
@@ -45,8 +45,8 @@ Currently, the following decorators are provided:
<email>mike@php.net</email>
<active>yes</active>
</developer>
- <date>2008-08-31</date>
- <time>15:00:00</time>
+ <date>2008-11-09</date>
+ <time>19:55:00</time>
<version>
<release>2.0.1</release>
<api>2.0.1</api>
@@ -59,6 +59,7 @@ Currently, the following decorators are provided:
<notes>- fixed bug #13933: undefined variable in the dataobjectsimple driver
- fixed bug #14323: wrong / no error from setLang() [cwiedmann]
- fixed bug in getLangs(), where certain formats were not recognized
+- request #14979: fluent interface for decorator's setOption() method
</notes>
<contents>
<dir name="/">
@@ -202,11 +203,12 @@ Currently, the following decorators are provided:
<release>stable</release>
<api>stable</api>
</stability>
- <date>2008-08-31</date>
+ <date>2008-11-09</date>
<license uri="http://www.debian.org/misc/bsd.license">BSD</license>
<notes>- fixed bug #13933: undefined variable in the dataobjectsimple driver
- fixed bug #14323: wrong / no error from setLang() [cwiedmann]
- fixed bug in getLangs(), where certain formats were not recognized
+- request #14979: fluent interface for decorator's setOption() method
</notes>
</release>
<release>
Please sign in to comment.
Something went wrong with that request. Please try again.