diff --git a/spec/Api/ProjectsSpec.php b/spec/Api/ProjectsSpec.php index 66f444b..a466626 100644 --- a/spec/Api/ProjectsSpec.php +++ b/spec/Api/ProjectsSpec.php @@ -24,9 +24,9 @@ public function it_is_initializable() public function it_calls_the_correct_url_on_all(Client $client) { - $client->request('GET', 'projects', [])->willReturn([]); + $client->request('GET', 'projects', ['orga_name' => 'foo', 'team_name' => 'bar'])->willReturn([]); - $this->all()->shouldBeArray(); + $this->all('foo', 'bar')->shouldBeArray(); } public function it_calls_the_correct_url_on_show_and_has_a_Pager_injected(Client $client) diff --git a/spec/Output/ProjectsSpec.php b/spec/Output/ProjectsSpec.php index 77245e1..496fed9 100644 --- a/spec/Output/ProjectsSpec.php +++ b/spec/Output/ProjectsSpec.php @@ -18,7 +18,7 @@ public function it_prints_a_table_on_all() $output = new BufferedOutput(); $this->all($output, [ [ - 'id' => '1337', + 'ids' => '1337', 'name' => 'digitalkaoz/versioneye-php', 'project_type' => 'composer', 'public' => false, diff --git a/src/Api/Projects.php b/src/Api/Projects.php index 8e3ff9e..a3ecf4b 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -14,11 +14,14 @@ class Projects extends BaseApi implements Api /** * shows user`s projects. * + * @param string $orgaName + * @param string $teamName + * * @return array */ - public function all() + public function all($orgaName, $teamName = null) { - return $this->request('projects'); + return $this->request('projects', 'GET', ['orga_name' => $orgaName, 'team_name' => $teamName]); } /** diff --git a/src/Output/Products.php b/src/Output/Products.php index ba52513..2e6ad21 100644 --- a/src/Output/Products.php +++ b/src/Output/Products.php @@ -47,10 +47,6 @@ public function show(OutputInterface $output, array $response) $response, function ($heading, $value) { if ('Source' === $heading) { - $value = array_filter($value, function ($link) { - return 'Source' === $link['name']; - }); - if (!empty($value)) { return array_pop($value)['link']; } diff --git a/src/Output/Projects.php b/src/Output/Projects.php index 48a7b79..44d07b0 100644 --- a/src/Output/Projects.php +++ b/src/Output/Projects.php @@ -21,7 +21,7 @@ public function all(OutputInterface $output, array $response) { $this->printTable($output, ['Key', 'Name', 'Type', 'Public', 'Dependencies', 'Outdated', 'Updated At', 'Bad Licenses', 'Unknown Licenses'], - ['id', 'name', 'project_type', 'public', 'dep_number', 'out_number', 'updated_at', 'licenses_red', 'licenses_unknown'], + ['ids', 'name', 'project_type', 'public', 'dep_number', 'out_number', 'updated_at', 'licenses_red', 'licenses_unknown'], $response, function ($key, $value) use ($output) { if ('public' === $key) {