src/Viserio/Component/Foundation/Bootstrap/LoadEnvironmentVariables.php
protected static function checkForSpecificEnvironmentFile(KernelContract $kernel, ?string $env): void
    {
        if ($kernel->isRunningInConsole() && ($input = new ArgvInput())->hasParameterOption(['--env', '-e'])) {
            if (static::setEnvironmentFilePath(
                $kernel,
                $kernel->getEnvironmentFile() . '.' . $input->getParameterOption(['--env', '-e'])
            )) {
                return;
            }
        }

        if ($env === null) {
            return;
        }

        static::setEnvironmentFilePath($kernel, $kernel->getEnvironmentFile() . '.' . $env);
    }
protected static function checkForSpecificEnvironmentFile(KernelContract $kernel, ?string $env): void
    {
        if ($kernel->isRunningInConsole() && ($input = new ArgvInput())->hasParameterOption(['--env', '-e'])) {
            if (static::setEnvironmentFilePath(
                $kernel,
                $kernel->getEnvironmentFile() . '.' . $input->getParameterOption(['--env', '-e'])
            )) {
                return;
            }
        }

        if ($env === null) {
            return;
        }

        static::setEnvironmentFilePath($kernel, $kernel->getEnvironmentFile() . '.' . $env);
    }
Detect if a custom environment file matching the APP_ENV exists.

@param \Viserio\Component\Contract\Foundation\Kernel $kernel
@param null|string                                   $env

@return void