Skip to content

Commit b3eb0cc

Browse files
committed
get rid of getSuperglobals
1 parent d4977d0 commit b3eb0cc

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

system/HTTP/IncomingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function isAJAX(): bool
266266
*/
267267
public function isSecure(): bool
268268
{
269-
$https = $this->getSuperglobals()->server('HTTPS');
269+
$https = service('superglobals')->server('HTTPS');
270270

271271
if ($https !== null && strtolower($https) !== 'off') {
272272
return true;

system/HTTP/RequestTrait.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ trait RequestTrait
6060
*/
6161
protected $globals = [];
6262

63-
/**
64-
* Get the Superglobals service instance.
65-
*/
66-
protected function getSuperglobals(): Superglobals
67-
{
68-
if ($this->superglobals === null) {
69-
$this->superglobals = service('superglobals');
70-
}
71-
72-
return $this->superglobals;
73-
}
74-
7563
/**
7664
* Gets the user's IP address.
7765
*
@@ -257,7 +245,7 @@ public function setGlobal(string $name, $value)
257245
$this->globals[$name] = $value;
258246

259247
// Also update Superglobals via service
260-
$this->getSuperglobals()->setGlobalArray($name, $value);
248+
service('superglobals')->setGlobalArray($name, $value);
261249

262250
return $this;
263251
}
@@ -378,6 +366,6 @@ protected function populateGlobals(string $name)
378366
}
379367

380368
// Get data from Superglobals service instead of direct access
381-
$this->globals[$name] = $this->getSuperglobals()->getGlobalArray($name);
369+
$this->globals[$name] = service('superglobals')->getGlobalArray($name);
382370
}
383371
}

0 commit comments

Comments
 (0)