Skip to content

refactor: fix Session and SessionInterface code #9535

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

Merged
merged 1 commit into from
Apr 21, 2025

Conversation

paulbalandan
Copy link
Member

Description
While looking at #9534 to find where the culprit is (in markAsTempData()), I found some points for improvements for the Session class:

  • Improve array PHPDocs by indicating their keys and values
  • array|bool|float|int|object|string|null is just the long form of mixed. If the type cannot be narrowed further (like string|int|null), I see no benefit in writing the long form instead of just mixed.
  • Simplify separate array and single operations

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

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Apr 20, 2025
michalsn
michalsn previously approved these changes Apr 20, 2025
@michalsn michalsn dismissed their stale review April 20, 2025 20:28

I noticed some potential problems in the markAsFlashdata() method.

@paulbalandan
Copy link
Member Author

Rebased to show the added tests pass on this refactor.

@paulbalandan paulbalandan merged commit e28f972 into codeigniter4:develop Apr 21, 2025
49 checks passed
@paulbalandan paulbalandan deleted the refactor-session branch April 21, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants