src/Providers/ConsoleServiceProvider.php
register accesses the super-global variable $_SERVER. Open
Open
public function register(): void
{
// Register console commands
$this->registerCommands($this->commands);
- Read upRead up
- Create a ticketCreate a ticket
- 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'];
}
}