phalcon / phalcon-devtools

Phalcon Developer Tools
https://docs.phalcon.io/latest/en/devtools
Other
1.33k stars 630 forks source link

Generated models::findFirst doesnt have a return type #1476

Closed talal424 closed 3 years ago

talal424 commented 3 years ago

Hello!

In raising this pull request, I confirm the following (please check boxes):

Small description of change:

when generating a new model the findFirst method doesn't have a return type and results in a fatal error

PHP Fatal error: Declaration of TestModel::findFirst($parameters = NULL) must be compatible with Phalcon\Mvc\Model::findFirst($parameters = NULL): ?Phalcon\Mvc\ModelInterface

fixed with adding return type compatible with Phalcon\Mvc\Model::findFirst

Thanks

Jeckerson commented 3 years ago

This won't be correct, as v4.0 has a bug and returns false instead of null.

talal424 commented 3 years ago

yeah i didn't know that

i'll convert this to a draft or delete it

Jeckerson commented 3 years ago

No problem. I'll close. In case you have any another code suggestions - feel free to submit PR.