Skip to content

Commit

Permalink
Merge ccbab3a into 579530b
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-brainlabs committed Apr 24, 2018
2 parents 579530b + ccbab3a commit 6ded7c3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/Trello/Api/Board/Labels.php
Expand Up @@ -84,4 +84,28 @@ public function setName($id, $color, $name)

return $this->put('boards/'.rawurlencode($id).'/labelNames/'.rawurlencode($color), array('value' => $name));
}

/**
* Create a list on a given board
* @link https://trello.com/docs/api/board/#post-1-boards-board-id-lists
*
* @param string $id the board's id
* @param string $color the label color to set the name of
* @param string $name
*
* @return array
*/
public function create($id, $color, $name)
{
$colors = array('blue', 'green', 'orange', 'purple', 'red', 'yellow');

if (!in_array($color, $colors)) {
throw new InvalidArgumentException(sprintf(
'The "color" parameter must be one of "%s".',
implode(", ", $colors)
));
}

return $this->post('boards/'.rawurlencode($id).'/labels/', array('name' => $name, 'color' => $color));
}
}

0 comments on commit 6ded7c3

Please sign in to comment.