My PhpStorm PHP autocomplete works but I can't customize it for modded inputs.
This is my method in the PHP class:
public function orientation($orientation = 'landscape')
{
}
First, I want this method to accept only the following values as input:
$orientation = 'landscape' , 'portrait' , 'square' , 'panoramic'
I want PhpStorm to suggest these values for input - that's the main problem.
In PHP 5.6 I suggest to turn the argument type into a value object instead of plain strings. This is how it looks like:
Note the private constructor and the factory functions taking care of proper initialization of the value object $orientation. This way you have an easy approach to narrow the available orientation options.
With later versions of PHP I suggest to use string backed enums instead. See: https://www.php.net/manual/en/language.enumerations.backed.php