Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - Allow usage of enums #17

Open
Zheness opened this issue Mar 7, 2018 · 1 comment
Open

Feature request - Allow usage of enums #17

Zheness opened this issue Mar 7, 2018 · 1 comment

Comments

@Zheness
Copy link

Zheness commented Mar 7, 2018

Hello,

It could be great to have enum field as argument, to restrict values that can be passed in parameters.

Example:

@param Enum['cat', 'dog', 'horse'] $animal

Or with support of multiple types:

$order = ['asc', 'desc'];
$availability = ['first day', 'second day', 'both'];
$widthAllowed = [45, 250, 700];

So if I send the value third day for my parameter $availability, it can returns me an error.

Thanks

@moufmouf
Copy link
Member

I cannot really parse the Enum['cat', 'dog', 'horse'] part as I'm using a third party library to parse annotations.
I'll look into supporting PHP "enum" libraries like myclabs/php-enum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants