src/Loader/Loader.php
load accesses the super-global variable $_SERVER. Open
Open
public function load(array $data): void
{
foreach ($data as $key => $value) {
if (!array_key_exists($key, $_ENV)) {
$this->writeInEnv($key, $value);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
writeInServer accesses the super-global variable $_SERVER. Open
Open
private function writeInServer(string $key, string $value): void
{
$_SERVER[$key] = $value;
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
writeInEnv accesses the super-global variable $_ENV. Open
Open
private function writeInEnv(string $key, string $value): void
{
$_ENV[$key] = $value;
}
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
load accesses the super-global variable $_ENV. Open
Open
public function load(array $data): void
{
foreach ($data as $key => $value) {
if (!array_key_exists($key, $_ENV)) {
$this->writeInEnv($key, $value);
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}