Skip to content

Conversation

@kenjis
Copy link
Member

@kenjis kenjis commented Aug 27, 2023

Description
If you call config(AuthJWT::class) (FQCN) and after that, call config('AuthJWT') (shortname),
the new instance is returned even if both are exactly the same class.
And the first shared instance is replaced with the next one.

See codeigniter4/shield#802

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

kenjis added 2 commits August 27, 2023 10:19
If the request class is the same, it is better to return the shared
instance.
If it is called by different aliase like `'App'` and `App::class`.
But if they are exactly the same FQCN, the shared instance should
be returned.
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them 4.4 labels Aug 27, 2023
@kenjis kenjis marked this pull request as draft August 27, 2023 01:32
@kenjis kenjis force-pushed the fix-factories-return-new-instance branch from 8b98540 to 1b88479 Compare August 27, 2023 02:28
@kenjis kenjis marked this pull request as ready for review August 27, 2023 02:31
@kenjis kenjis mentioned this pull request Aug 29, 2023
9 tasks
@kenjis kenjis merged commit bb0cd96 into codeigniter4:develop Aug 29, 2023
@kenjis kenjis deleted the fix-factories-return-new-instance branch August 29, 2023 23:55
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.

3 participants