Closed kavnik closed 4 years ago
There are no enums in PHP, but it might be useful to add constants for available string values.
For example, in sendChatAction there is a parameter action with available values: typing, upload_photo , record_video etc.
For this values it's possible to add constants in SendChatAction class: const TYPE_TYPING = 'typing'; const TYPE_UPLOAD_PHOTO = 'upload_photo'; ...
const TYPE_TYPING = 'typing';
const TYPE_UPLOAD_PHOTO = 'upload_photo';
IDE will allow you to avoid typos and will give a prompt with autocomplete.
Hi @kavnik : This is certainly possible and also a good idea 👍
You can shoot in a PR or wait until I got time to implement it (which will possibly be tonight)
Implemented in v3.6.0!
There are no enums in PHP, but it might be useful to add constants for available string values.
For example, in sendChatAction there is a parameter action with available values: typing, upload_photo , record_video etc.
For this values it's possible to add constants in SendChatAction class:
const TYPE_TYPING = 'typing';
const TYPE_UPLOAD_PHOTO = 'upload_photo';
...IDE will allow you to avoid typos and will give a prompt with autocomplete.