Skip to content

Commit

Permalink
Use the new user-access API
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Dec 20, 2023
1 parent de8acd8 commit c7400c7
Show file tree
Hide file tree
Showing 9 changed files with 462 additions and 317 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"guzzlehttp/guzzle": "^5.3",
"guzzlehttp/ringphp": "^1.1",
"platformsh/console-form": ">=0.0.37 <2.0",
"platformsh/client": ">=0.78.1 <2.0",
"platformsh/client": ">=0.79.2 <2.0",
"symfony/console": "^3.0 >=3.2",
"symfony/yaml": "^3.0 || ^2.6",
"symfony/finder": "^3.0",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 0 additions & 33 deletions src/Command/CompletionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,12 @@ protected function runCompletion()
Completion::TYPE_ARGUMENT,
[$this, 'getEnvironmentsForCheckout']
),
new Completion(
'user:role',
'email',
Completion::TYPE_ARGUMENT,
[$this, 'getUserEmails']
),
new Completion(
'user:role',
'level',
Completion::TYPE_OPTION,
['project', 'environment']
),
new Completion(
'user:delete',
'email',
Completion::TYPE_ARGUMENT,
[$this, 'getUserEmails']
),
new Completion\ShellPathCompletion(
'ssh-key:add',
'path',
Expand Down Expand Up @@ -288,27 +276,6 @@ public function getEnvironments()
return array_keys($this->api->getEnvironments($project, false, false));
}

/**
* Get a list of user email addresses.
*
* @return string[]
*/
public function getUserEmails()
{
$project = $this->getProject();
if (!$project) {
return [];
}

$emails = [];
foreach ($this->api->getProjectAccesses($project) as $projectAccess) {
$account = $this->api->getAccount($projectAccess);
$emails[] = $account['email'];
}

return $emails;
}

/**
* Get the project ID the user has already entered on the command line.
*
Expand Down
Loading

0 comments on commit c7400c7

Please sign in to comment.