Skip to content

refactor: fix phpstan no type specified UpdateModelTest#10016

Merged
michalsn merged 3 commits into
codeigniter4:developfrom
adiprsa:fix/PHPSTAN-no-type-specified-UpdateModelTest
Mar 5, 2026
Merged

refactor: fix phpstan no type specified UpdateModelTest#10016
michalsn merged 3 commits into
codeigniter4:developfrom
adiprsa:fix/PHPSTAN-no-type-specified-UpdateModelTest

Conversation

@adiprsa

@adiprsa adiprsa commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Description
#7731

Checklist:

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

@neznaika0 neznaika0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does phpdoc make sense when you can use native php typing: string $name? Or is it causing errors?

@adiprsa

adiprsa commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

Does phpdoc make sense when you can use native php typing: string $name? Or is it causing errors?

no error, i will change
i will left phpdoc for $_options

@adiprsa adiprsa force-pushed the fix/PHPSTAN-no-type-specified-UpdateModelTest branch from 9062adc to 6bd0c55 Compare March 4, 2026 06:20
@adiprsa adiprsa requested a review from neznaika0 March 4, 2026 06:26
@neznaika0

Copy link
Copy Markdown
Contributor

I'm not sure if the dates are numbers - they're not used for verification. But it seems to be strings, if you look at it $_options

@adiprsa

adiprsa commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure if the dates are numbers - they're not used for verification. But it seems to be strings, if you look at it $_options

SaveModelTest

tests/system/Models/SaveModelTest.php

my reference from this

@neznaika0

Copy link
Copy Markdown
Contributor

Then it's a Time or DateTimeInterface

@adiprsa

adiprsa commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

Then it's a Time or DateTimeInterface

/**
 * @var \Time|\DateTime
 */
protected $created_at;

like this?

@neznaika0

neznaika0 commented Mar 4, 2026

Copy link
Copy Markdown
Contributor
protected DateTimeInterface $created_at;

Try to study the structure more deeply.
I understand that it's not difficult to send a PR, but we can discuss one phrase for a long time 😄

@michalsn michalsn merged commit a002b7c into codeigniter4:develop Mar 5, 2026
47 checks passed
@michalsn

michalsn commented Mar 5, 2026

Copy link
Copy Markdown
Member

Thank you @adiprsa

@adiprsa adiprsa deleted the fix/PHPSTAN-no-type-specified-UpdateModelTest branch March 6, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants