thephpleague / climate

PHP's best friend for the terminal.
http://climate.thephpleague.com
MIT License
1.87k stars 126 forks source link

Code is not friendly for static analysis by smart IDEs like PhpStorm #179

Closed gugglegum closed 3 years ago

gugglegum commented 3 years ago

Many magic methods without proper PhpDoc annotations is not good. Also design allows to use dynamic method names which may contain style methods inside. What it need for? Are you too busy to type 2 methods and want to use single method for both? It's a very controversial design that I consider to be outdated.

 * @method mixed padding(integer $length = 0, string $char = '.')
 * @method mixed input(string $prompt, Util\Reader\ReaderInterface $reader = null)
 * @method mixed confirm(string $prompt, Util\Reader\ReaderInterface $reader = null)
 * @method mixed password(string $prompt, Util\Reader\ReaderInterface $reader = null)
 * @method mixed checkboxes(string $prompt, array $options, Util\Reader\ReaderInterface $reader = null)
 * @method mixed radio(string $prompt, array $options, Util\Reader\ReaderInterface $reader = null)

When type is mixed IDE can't know how to interpret this property.

duncan3dc commented 3 years ago

Hi there,

What it need for? Are you too busy to type 2 methods and want to use single method for both?

This is part of the original design of the library from 7 years ago, it was a choice that was made to support that style of dynamic method, you are free to use a single method for both, the library lets you do that.

It's a very controversial design that I consider to be outdated.

Thanks for sharing your opinion, perhaps this library is not for you