hm2k/PHP_Mailman — Issue #4: Documented @return types don't match code
Author: Haprog
Created: 2012-01-04 14:23:14+00:00
State: open

See for example:
https://github.com/hm2k/PHP_Mailman/blob/master/PHP/Mailman.php#L101

setList function comment says `@return boolean Returns whether it was set or not` but this is not true since the function only returns null (`return;` on line [115](https://github.com/hm2k/PHP_Mailman/blob/master/PHP/Mailman.php#L115)) or the string that was supplied to it (`return $this->list = $string;` on line [117](https://github.com/hm2k/PHP_Mailman/blob/master/PHP/Mailman.php#L117)). It never returns a boolean value.

I think this functions code should be changed to:

```ruby
protected function setList($string)
{
if (!is_string($string)) {
$this->setError(
__METHOD__ . ' expects parameter 1 to be string, ' .
gettype($string) . ' given'
);
return false;
}
$this->list = $string;
return true;
}
```

There are similar errors in many other functions also.