| @@ 45-57 (lines=13) @@ | ||
| 42 | * |
|
| 43 | * @return array |
|
| 44 | */ |
|
| 45 | public function show($id, $color) |
|
| 46 | { |
|
| 47 | $colors = array('blue', 'green', 'orange', 'purple', 'red', 'yellow'); |
|
| 48 | ||
| 49 | if (!in_array($color, $colors)) { |
|
| 50 | throw new InvalidArgumentException(sprintf( |
|
| 51 | 'The "color" parameter must be one of "%s".', |
|
| 52 | implode(", ", $colors) |
|
| 53 | )); |
|
| 54 | } |
|
| 55 | ||
| 56 | return $this->get($this->getPath($id).'/'.rawurlencode($color)); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * Set a label's name on a given board and for a given color |
|
| @@ 53-60 (lines=8) @@ | ||
| 50 | * |
|
| 51 | * @throws InvalidArgumentException If a label does not exist |
|
| 52 | */ |
|
| 53 | public function remove($id, $label) |
|
| 54 | { |
|
| 55 | if (!in_array($label, array('green', 'yellow', 'orange', 'red', 'purple', 'blue'))) { |
|
| 56 | throw new InvalidArgumentException(sprintf('Label "%s" does not exist.', $label)); |
|
| 57 | } |
|
| 58 | ||
| 59 | return $this->delete($this->getPath($id).'/'.rawurlencode($label)); |
|
| 60 | } |
|
| 61 | } |
|
| 62 | ||