Code Duplication    Length = 8-13 lines in 2 locations

lib/Trello/Api/Board/Labels.php 1 location

@@ 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
     * Add a label related to a given board

lib/Trello/Api/Card/Labels.php 1 location

@@ 72-79 (lines=8) @@
69
     *
70
     * @throws InvalidArgumentException If a label does not exist
71
     */
72
    public function remove($id, $label)
73
    {
74
        if (!in_array($label, array('green', 'yellow', 'orange', 'red', 'purple', 'blue'))) {
75
            throw new InvalidArgumentException(sprintf('Label "%s" does not exist.', $label));
76
        }
77
78
        return $this->delete($this->getPath($id).'/'.rawurlencode($label));
79
    }
80
    
81
   /**
82
     * Remove a given label from a given card based on the label id