Code Duplication    Length = 5-5 lines in 2 locations

lib/Trello/Model/Checklist.php 2 locations

@@ 151-155 (lines=5) @@
148
     */
149
    public function hasItem($nameOrId)
150
    {
151
        foreach ($this->getItems() as $item) {
152
            if ($item['name'] === $nameOrId || (isset($item['id']) && $item['id'] === $nameOrId)) {
153
                return true;
154
            }
155
        }
156
157
        return false;
158
    }
@@ 165-169 (lines=5) @@
162
     */
163
    public function getItemKey($nameOrId)
164
    {
165
        foreach ($this->getItems() as $key => $item) {
166
            if ($item['name'] === $nameOrId || (isset($item['id']) && $item['id'] === $nameOrId)) {
167
                return $key;
168
            }
169
        }
170
171
        throw new InvalidArgumentException(sprintf(
172
            'Checklist "%s" does not have an item with name or id "%s"',