Add GlobalRequest #3

Merged
c.fahner merged 5 commits from issues/1 into main 2026-06-27 10:29:59 +02:00
Owner

Resolves #1.

Resolves #1.
c.fahner added this to the v0.1 milestone 2026-05-10 20:39:22 +02:00
@ -0,0 +41,4 @@
* @since 1.0
* @return Networked<Request>
*/
public static function instance(): Networked {
Author
Owner

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.

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.
c.fahner marked this conversation as resolved
@ -0,0 +11,4 @@
/**
* @internal
* @implements IteratorAggregate<Stringable|string>
Author
Owner

Stringable may not be necessary here

`Stringable` may not be necessary here
c.fahner marked this conversation as resolved
@ -0,0 +26,4 @@
/** @var array<string,?Field> */
private array $fields = [ ];
public static function instance(): self {
Author
Owner

Should also always return a new instance.

Should also always return a new instance.
c.fahner marked this conversation as resolved
@ -0,0 +24,4 @@
get => _PostView::instance();
}
public static function instance(): self {
Author
Owner

Should also always return a new instance.

Should also always return a new instance.
c.fahner marked this conversation as resolved
@ -0,0 +35,4 @@
get => _GetView::instance();
}
public static function instance(): self {
Author
Owner

Should also just return a new instance (or just use the constructor).

Should also just return a new instance (or just use the constructor).
c.fahner marked this conversation as resolved
@ -0,0 +27,4 @@
public readonly ArrayObject $root;
public static function instance(): self {
return self::$instance ??= new self;
Author
Owner

New instance every time (or constructor).

New instance every time (or constructor).
c.fahner marked this conversation as resolved
c.fahner added spent time 2026-06-27 10:29:35 +02:00
10 minutes
c.fahner deleted branch issues/1 2026-06-27 10:29:59 +02:00
c.fahner referenced this pull request from a commit 2026-06-27 10:30:01 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 10 minutes
c.fahner
10 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
slendium/http-superglobals!3
No description provided.