public static function getRemoteEnvironments()
    {
        $environments = [];

        foreach (self::getProjectConfig()->getRemote() as $remote) {
            foreach ($remote as $environment) {
                if (!isset($environment['realm'])) {
                    continue;
                }
                $realm = $environment['realm'];
                unset($environment['realm']);

                $environments[$realm][] = $environment;
            }
        }

        return $environments;
    }