function Kernel::getContainerClass
Gets the container class.
Throws
\InvalidArgumentException If the generated classname is invalid
2 calls to Kernel::getContainerClass()
- Kernel::getKernelParameters in vendor/
symfony/ http-kernel/ Kernel.php - Returns the kernel parameters.
- Kernel::initializeContainer in vendor/
symfony/ http-kernel/ Kernel.php - Initializes the service container.
File
-
vendor/
symfony/ http-kernel/ Kernel.php, line 362
Class
- Kernel
- The Kernel is the heart of the Symfony system.
Namespace
Symfony\Component\HttpKernelCode
protected function getContainerClass() : string {
$class = static::class;
$class = str_contains($class, "@anonymous\x00") ? get_parent_class($class) . str_replace('.', '_', ContainerBuilder::hash($class)) : $class;
$class = str_replace('\\', '_', $class) . ucfirst($this->environment) . ($this->debug ? 'Debug' : '') . 'Container';
if (!preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $class)) {
throw new \InvalidArgumentException(\sprintf('The environment "%s" contains invalid characters, it can only contain characters allowed in PHP class names.', $this->environment));
}
return $class;
}