Skip to content

refactor: add precise return type to CodeIgniter::getPerformanceStats() - #10458

Merged
paulbalandan merged 1 commit into
codeigniter4:developfrom
soccerlover29:fix/getperformancestats-return-type
Aug 14, 2026
Merged

refactor: add precise return type to CodeIgniter::getPerformanceStats()#10458
paulbalandan merged 1 commit into
codeigniter4:developfrom
soccerlover29:fix/getperformancestats-return-type

Conversation

@soccerlover29

Copy link
Copy Markdown
Contributor

Description

Adds a specific return-type annotation to CodeIgniter::getPerformanceStats() so static analysis knows exactly what's in the returned array (startTime: float|null and totalTime: float), instead of just "array". Removes the now-unneeded PHPStan baseline suppression for this method.

Contributes to #8732 (PHPStan "no value type specified in iterable type array" cleanup).

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

Adds an array shape docblock so PHPStan knows the return type is
array{startTime: float|null, totalTime: float} instead of a bare
array. Removes the now-unnecessary baseline suppression.
@mergeable

mergeable Bot commented Aug 13, 2026

Copy link
Copy Markdown

Hi there, soccerlover29! 👋

Thank you for sending this PR!

We expect the following in all Pull Requests (PRs).

Important

We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.

If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work
on the framework than you do. Please make it as painless for your contributions to be included as possible.

See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

Sincerely, the mergeable bot 🤖

@paulbalandan paulbalandan changed the title refactor: add precise return type to CodeIgniter::getPerformanceStats() refactor: add precise return type to CodeIgniter::getPerformanceStats() Aug 14, 2026
@paulbalandan
paulbalandan merged commit 9e990b5 into codeigniter4:develop Aug 14, 2026
56 checks passed
@paulbalandan

Copy link
Copy Markdown
Member

Thank you, @soccerlover29

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.

2 participants