class CliContextProvider
Tries to provide context on CLI.
@author Maxime Steinhausser <maxime.steinhausser@gmail.com>
Hierarchy
- class \Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider implements \Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface
Expanded class hierarchy of CliContextProvider
1 file declares its use of CliContextProvider
- VarDumper.php in vendor/
symfony/ var-dumper/ VarDumper.php
File
-
vendor/
symfony/ var-dumper/ Dumper/ ContextProvider/ CliContextProvider.php, line 19
Namespace
Symfony\Component\VarDumper\Dumper\ContextProviderView source
final class CliContextProvider implements ContextProviderInterface {
public function getContext() : ?array {
if ('cli' !== \PHP_SAPI) {
return null;
}
return [
'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []),
'identifier' => hash('crc32b', $commandLine . $_SERVER['REQUEST_TIME_FLOAT']),
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
CliContextProvider::getContext | public | function | Overrides ContextProviderInterface::getContext |