private function getUniqueKernelKey(): string
    {
        if ($this->undescoredKernelName !== null) {
            return $this->undescoredKernelName;
        }

        $classParts = explode('\\', self::class);

        $bareClassName = array_pop($classParts);
        $bareClassNameWithoutSuffix = Strings::substring($bareClassName, 0, -strlen('Kernel'));
        $bareClassNameWithoutSuffix = lcfirst($bareClassNameWithoutSuffix);

        $this->undescoredKernelName = Strings::replace(
            $bareClassNameWithoutSuffix,
            '#[A-Z]#',
            function (array $matches): string {
                return '_' . strtolower($matches[0]);
            }
        );

        return $this->undescoredKernelName;
    }
private function getUniqueKernelKey(): string
    {
        if ($this->undescoredKernelName !== null) {
            return $this->undescoredKernelName;
        }

        $classParts = explode('\\', self::class);

        $bareClassName = array_pop($classParts);
        $bareClassNameWithoutSuffix = Strings::substring($bareClassName, 0, -strlen('Kernel'));
        $bareClassNameWithoutSuffix = lcfirst($bareClassNameWithoutSuffix);

        $this->undescoredKernelName = Strings::replace(
            $bareClassNameWithoutSuffix,
            '#[A-Z]#',
            function (array $matches): string {
                return '_' . strtolower($matches[0]);
            }
        );

        return $this->undescoredKernelName;
    }
private function getUniqueKernelKey ( ) : string { if ( $ this -> undescoredKernelName !== null ) { return $ this -> undescoredKernelName ; } $ classParts = explode ( '\\' , self :: class ) ; $ bareClassName = array_pop ( $ classParts ) ; $ bareClassNameWithoutSuffix = Strings :: substring ( $ bareClassName , 0 , - strlen ( 'Kernel' ) ) ; $ bareClassNameWithoutSuffix = lcfirst ( $ bareClassNameWithoutSuffix ) ; $ this -> undescoredKernelName = Strings :: replace ( $ bareClassNameWithoutSuffix , '#[A-Z]#' , function ( array $ matches ) : string { return '_' . strtolower ( $ matches [ 0 ] ) ; } ) ; return $ this -> undescoredKernelName ; }
E.g. "TokenRunnerKernel" => "token_runner"
E . g . TokenRunnerKernel = > token_runner