private function getEnvironmentRoles(ProjectAccess $projectAccess)
    {
        $environmentRoles = [];
        if ($projectAccess->role === ProjectAccess::ROLE_ADMIN) {
            return [];
        }

        // @todo find out why $environment->getUser() has permission issues - it would be a lot faster than this

        $progress = new ProgressBar(isset($this->stdErr) && $this->stdErr->isDecorated() ? $this->stdErr : new NullOutput());
        $progress->setMessage('Loading environments...');
        $progress->setFormat('%message% %current%/%max%');
        $environments = $this->api()->getEnvironments($this->getSelectedProject());
        $progress->start(count($environments));
        foreach ($environments as $environment) {
            if ($access = $environment->getUser($projectAccess->id)) {
                $environmentRoles[$environment->id] = $access->role;
            }
            $progress->advance();
        }
        $progress->finish();
        $progress->clear();

        return $environmentRoles;
    }
private function getEnvironmentRoles(ProjectAccess $projectAccess)
    {
        $environmentRoles = [];
        if ($projectAccess->role === ProjectAccess::ROLE_ADMIN) {
            return [];
        }

        // @todo find out why $environment->getUser() has permission issues - it would be a lot faster than this

        $progress = new ProgressBar(isset($this->stdErr) && $this->stdErr->isDecorated() ? $this->stdErr : new NullOutput());
        $progress->setMessage('Loading environments...');
        $progress->setFormat('%message% %current%/%max%');
        $environments = $this->api()->getEnvironments($this->getSelectedProject());
        $progress->start(count($environments));
        foreach ($environments as $environment) {
            if ($access = $environment->getUser($projectAccess->id)) {
                $environmentRoles[$environment->id] = $access->role;
            }
            $progress->advance();
        }
        $progress->finish();
        $progress->clear();

        return $environmentRoles;
    }
private function getEnvironmentRoles ( ProjectAccess $ projectAccess ) { $ environmentRoles = [ ] ; if ( $ projectAccess -> role === ProjectAccess :: ROLE_ADMIN ) { return [ ] ; } // @todo find out why $environment->getUser() has permission issues - it would be a lot faster than this $ progress = new ProgressBar ( isset ( $ this -> stdErr ) && $ this -> stdErr -> isDecorated ( ) ? $ this -> stdErr : new NullOutput ( ) ) ; $ progress -> setMessage ( 'Loading environments...' ) ; $ progress -> setFormat ( '%message% %current%/%max%' ) ; $ environments = $ this -> api ( ) -> getEnvironments ( $ this -> getSelectedProject ( ) ) ; $ progress -> start ( count ( $ environments ) ) ; foreach ( $ environments as $ environment ) { if ( $ access = $ environment -> getUser ( $ projectAccess -> id ) ) { $ environmentRoles [ $ environment -> id ] = $ access -> role ; } $ progress -> advance ( ) ; } $ progress -> finish ( ) ; $ progress -> clear ( ) ; return $ environmentRoles ; }
Load the user's roles on the project's environments.

@param \Platformsh\Client\Model\ProjectAccess $projectAccess

@return array
Load the user s roles on the project s environments .