Add GlobalRequest #3
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 10 minutes
Due date
c.fahner
10 minutes
No due date set.
Dependencies
No dependencies set.
Reference
slendium/http-superglobals!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issues/1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #1.
@ -0,0 +41,4 @@* @since 1.0* @return Networked<Request>*/public static function instance(): Networked {A new instance should be returned every time.
From what I understand, tools like FrankenPHP refresh the superglobals. This means the cached results of calculated values (such as parsed headers or parsed JSON body) would not get refreshed if the same global instance is returned again.
@ -0,0 +11,4 @@/*** @internal* @implements IteratorAggregate<Stringable|string>Stringablemay not be necessary here@ -0,0 +26,4 @@/** @var array<string,?Field> */private array $fields = [ ];public static function instance(): self {Should also always return a new instance.
@ -0,0 +24,4 @@get => _PostView::instance();}public static function instance(): self {Should also always return a new instance.
@ -0,0 +35,4 @@get => _GetView::instance();}public static function instance(): self {Should also just return a new instance (or just use the constructor).
@ -0,0 +27,4 @@public readonly ArrayObject $root;public static function instance(): self {return self::$instance ??= new self;New instance every time (or constructor).