Symfony run hint kernel.secret parameter not found



PHP Snippet 1:

<?php
namespace App;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;

class Kernel extends BaseKernel{

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
    }

    public function registerBundles()
    {
        $contents = [
            \Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
        ];

        foreach ($contents as $class => $envs) {
            if (isset($envs["all"]) || isset($envs[$this->environment])) {
                yield new $class();
            }
        }
    }

    // Modify location
    public function build(ContainerBuilder $container)
    {
        parent::build($container); // TODO: Change the autogenerated stub
        $container->setParameter("kernel.secret", "abck");
    }
}