Doc #71762 [Com]: Gmagick::destroy() returns bool, not Gmagick

From: Date: Sun, 13 Mar 2016 11:30:39 +0000
Subject: Doc #71762 [Com]: Gmagick::destroy() returns bool, not Gmagick
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13318@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71762&edit=1 ID: 71762 Comment by: benjamin dot morel at gmail dot com Reported by: benjamin dot morel at gmail dot com Summary: Gmagick::destroy() returns bool, not Gmagick Status: Open Type: Documentation Problem Package: gmagick Operating System: N/A PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The issue has been fixed on GitHub, destroy() can only return bool now: https://github.com/vitoc/gmagick/commit/d7dc731608c32147b10d8f1f8a80eabb71577b13 So the doc should reflect this: public bool Gmagick::destroy ( void ) Previous Comments: ------------------------------------------------------------------------ [2016-03-10 18:06:32] benjamin dot morel at gmail dot com I just opened a bug on GitHub, I suggest we wait for the feedback of the extension author before we update the doc! https://github.com/vitoc/gmagick/issues/39 ------------------------------------------------------------------------ [2016-03-10 18:00:59] benjamin dot morel at gmail dot com Indeed, then when should document it as returning Gmagick|bool, I guess. I just tested however, and can't get it to return false, even when destroying it multiple times: $g = new Gmagick(); echo get_class($g->destroy()); // Gmagick echo get_class($g->destroy()); // Gmagick ------------------------------------------------------------------------ [2016-03-10 17:50:57] cmb@php.net It appears the proto in the sources is wrong. ::destroy() either returns FALSE or itself, see <https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L762> <https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L769> <https://github.com/vitoc/gmagick/blob/master/php_gmagick_macros.h#L24> ------------------------------------------------------------------------ [2016-03-10 00:22:27] benjamin dot morel at gmail dot com Description: ------------ http://php.net/manual/en/gmagick.destroy.php Source: https://github.com/vitoc/gmagick/blob/master/gmagick_methods.c#L748 Equivalent in Imagick: http://php.net/manual/en/imagick.destroy.php Expected result: ---------------- public bool Gmagick::destroy ( void ) Actual result: -------------- public Gmagick Gmagick::destroy ( void ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71762&edit=1

« previous php.doc.bugs (#13318) next »