There are already 2 similar questions of this type here on SO but none of the answers seem to work.
PHPDoc doesn't seem to recognize optional parameters in my functions as optional, for example:
/**
* Opens the connection and sets encoding
*
* @param string $encoding Encoding.
*/
public function __construct($encoding='UTF-8')
{
$this->connect_mysqli();
$this->set_encoding_mysqli($encoding);
}
Shouldn't it recognize $encoding as being optional or am I missing something here? I really tried to google and read the documentation but all I found is:
If you are not indicating in the actual code that the parameter is optional (via "$paramname = 'a default value'"), then you should mention in the parameter's description that the parameter is optional.
So I see no problem with my code, but all I get in documentation is: "__construct(string $encoding)", no sign anywhere that parameter is optional.