ZF-10676: getList() doesn't return array if no translations are available in adapter
Description
PHPdoc comment for Zend_Translate_Adapter::getList() declares that method will always return array, but in a case if there is no translations are available in adapter it returns NULL.
From source code:
/**
* Returns the available languages from this adapter
*
* @return array
*/
public function getList()
{
$list = array_keys($this->_translate);
$result = null; // <--- This is wrong, it should be $result = array();
foreach($list as $value) {
if (!empty($this->_translate[$value])) {
$result[$value] = $value;
}
}
return $result;
}
Comments
Posted by Oleg Lobach (bladeofsteel) on 2010-11-18T12:41:20.000+0000
Here is small patch to fix this typo bug
Posted by Oleg Lobach (bladeofsteel) on 2010-11-18T12:48:14.000+0000
Check my trivial patch, plz.
Posted by Oleg Lobach (bladeofsteel) on 2010-12-16T05:44:41.000+0000
Fixed with SVN:r23517 and SVN:r23518
Posted by Thomas Weidner (thomas) on 2010-12-18T09:28:38.000+0000
Fixed with 11.Dec. Accepted for ZF2 with 17.Dec.
Posted by Thomas Weidner (thomas) on 2010-12-18T09:30:20.000+0000
Note that the patch for 1.11 is incorrect