Skip to content

Commit 09dd2f6

Browse files
committed
Recursion parameter for getting images (close #17)
1 parent 6ae9155 commit 09dd2f6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
77

88
# Unreleased
99

10+
## Added
11+
- Recursion parameter for getting images (#17)
12+
1013
## Changed
1114
- Make networks project aware (#16)
1215

src/Endpoint/Images.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ protected function getEndpoint()
1818
*
1919
* @return array
2020
*/
21-
public function all()
21+
public function all(int $recursion = 0)
2222
{
2323
$images = [];
2424

2525
$config = [
2626
"project"=>$this->client->getProject()
2727
];
2828

29+
if ($recursion > 0) {
30+
$config["recursion"] = $recursion;
31+
}
32+
2933
foreach ($this->get($this->getEndpoint(), $config) as $image) {
3034
$images[] = str_replace('/'.$this->client->getApiVersion().$this->getEndpoint(), '', $image);
3135
}

0 commit comments

Comments
 (0)