WCF icon indicating copy to clipboard operation
WCF copied to clipboard

Fix Database::getInsertID() return type PHPDoc

Open netzhuffle opened this issue 3 years ago • 0 comments

The PHPDoc claimed that PDO::lastInsertId() returns an integer, while the actual return type is false|string.

Apart from developer confusion, wrong types mainly is an issue for static analysis and other automated code tools. With PHP return type annotations this could mislead a developer too and produce exceptions in 3rd party code explicitly stating PHP return types.

(Alternatively, this could be fixed by casting the string to an int. That solution may have other issues though.)

netzhuffle avatar Aug 01 '22 15:08 netzhuffle