| @@ 74-86 (lines=13) @@ | ||
| 71 | * |
|
| 72 | * @return array |
|
| 73 | */ |
|
| 74 | public function setName($id, $color, $name) |
|
| 75 | { |
|
| 76 | $colors = array('blue', 'green', 'orange', 'purple', 'red', 'yellow'); |
|
| 77 | ||
| 78 | if (!in_array($color, $colors)) { |
|
| 79 | throw new InvalidArgumentException(sprintf( |
|
| 80 | 'The "color" parameter must be one of "%s".', |
|
| 81 | implode(", ", $colors) |
|
| 82 | )); |
|
| 83 | } |
|
| 84 | ||
| 85 | return $this->put('boards/'.rawurlencode($id).'/labelNames/'.rawurlencode($color), array('value' => $name)); |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * Create a list on a given board |
|
| @@ 98-110 (lines=13) @@ | ||
| 95 | * |
|
| 96 | * @return array |
|
| 97 | */ |
|
| 98 | public function create($id, $color, $name) |
|
| 99 | { |
|
| 100 | $colors = array('blue', 'green', 'orange', 'purple', 'red', 'yellow'); |
|
| 101 | ||
| 102 | if (!in_array($color, $colors)) { |
|
| 103 | throw new InvalidArgumentException(sprintf( |
|
| 104 | 'The "color" parameter must be one of "%s".', |
|
| 105 | implode(", ", $colors) |
|
| 106 | )); |
|
| 107 | } |
|
| 108 | ||
| 109 | return $this->post('boards/'.rawurlencode($id).'/labels/', array('name' => $name, 'color' => $color)); |
|
| 110 | } |
|
| 111 | } |
|
| 112 | ||