refactor: Update types for BaseModel, Model and dependencies#9711
refactor: Update types for BaseModel, Model and dependencies#9711neznaika0 wants to merge 4 commits intocodeigniter4:4.7from
BaseModel, Model and dependencies#9711Conversation
42136ab to
11a3252
Compare
michalsn
left a comment
There was a problem hiding this comment.
-
Some methods have a
$testingparameter, which set totrue, will not execute the query and just return the SQL. -
No array - as we do not support composite keys in the model right now. Support for
0and'0'is problematic, and I would rather not allow it, as it will cause problems when combined with$db->insertID(), which uses0to indicate a failure.
|
michalsn
left a comment
There was a problem hiding this comment.
- The message can stay, for reference.
|
👋 Hi, @neznaika0! |
e985209 to
0174725
Compare
|
Is there a solution for PHPDoc types? Take a look if you have time https://talk.typo3.org/t/phpstan-specific-phpdoc-annotations-in-the-core-code-base/5504/1 |
|
Unfortunately, we barely discuss common questions. There are no exact definitions of how to write code. I'm closing the PR. |
Description
Updated PHPDoc, clarified arrays, duplicate comments have been removed from the Model and did some work with dots.
I generated the API using phpDocumentor. I didn't notice any serious problems.
Some questions:
$idforBaseModel::doFind()doFindColumn() findColumn()- not sure about the type accuracyBaseModel::getIdValue()does not return an array. Right? I have removed PHPDoc and array checking. Is it possible to use 0, '0' for ID? Otherwise, I would have added the checks toBaseModel::shouldUpdate().Checklist: