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

docs: allow boolean values in the model for PHPStan #9276

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

ping-yee
Copy link
Contributor

@ping-yee ping-yee commented Nov 13, 2024

Description
fix #9197

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@neznaika0
Copy link
Contributor

neznaika0 commented Nov 13, 2024

Ignored error pattern ...

requires removal from phpstan-baseline.php

@michalsn
Copy link
Member

@datamweb Will this solve the whole issue, or not?

@datamweb
Copy link
Contributor

@michalsn In my opinion, it’s better to write a unit test for this, as I can’t practically verify the issue for all drivers. However, this can be handled through GitHub Actions to ensure proper verification.

@michalsn
Copy link
Member

@datamweb I was under the impression that it was just a problem of setting allowed data types for PHPStan, which now treated booleans as an error.

We already have tests for boolean values: https://github.com/codeigniter4/CodeIgniter4/blob/develop/tests/system/Database/Live/UpdateTest.php#L363

Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalsn, thank you so much for sharing the tests. 🙏 Also, the tests for PR #6348 are available as well.

@ping-yee , please edit the PR description and change See #9197 to fix #9197. Thanks! 😊

@michalsn michalsn changed the title docs: add the type to row_array in model. docs: allow boolean values in the model for PHPStan Nov 17, 2024
@michalsn michalsn merged commit 42801e7 into codeigniter4:develop Nov 17, 2024
41 checks passed
@ping-yee ping-yee deleted the 9197_model_doc branch November 28, 2024 13:02
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [Model] Limitation in Boolean Support (true/false) in update()/save()/insert()
5 participants