Webklex / php-imap

PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication process as well.
https://www.php-imap.com
MIT License
308 stars 145 forks source link

Better function return typing #473

Open olliescase opened 8 months ago

olliescase commented 8 months ago

Is your feature request related to a problem? Please describe. Better typing for return values to allow for more successful prompts when function chaining.

Describe the solution you'd like For each function that returns $this to be typed to return static instead of self, and also for the docblock to be @return $this where sometimes it exists @return ClassName

Describe alternatives you've considered There are two possibilities;

  1. Fix only in docblocks. This has absolutely no impact to the implementation.
  2. Fix both the return type hints and docblocks - this has a functional difference, but shouldn't impact anything.

Additional context I have created #470 already, but thought I'd create an issue so it can be tracked more easily :)