Code Duplication    Length = 5-7 lines in 2 locations

src/Reservations/ReservationsPlugin.php 2 locations

@@ 171-177 (lines=7) @@
168
        $resource = $this->resources->getResource($key);
169
        if ($resource === null) {
170
            $results[] = "$key not found.";
171
        } else {
172
            if (empty($resource)) {
173
                $results[] = "$key is free.";
174
            } else {
175
                $results[] = "$key is reserved by {$resource['user']}.";
176
            }
177
        }
178
        $msg->reply(implode(',', $results));
179
        $msg->setHandled(true);
180
    }
@@ 239-243 (lines=5) @@
236
                if ($please || $resource['user'] === $username) {
237
                    $this->resources->release($key);
238
                    $results[] = "Released $key.";
239
                } else {
240
                    $results[] = "$key is reserved by {$resource['user']}";
241
                    $results[] = "you may use 'release $key please' or 'please release $key'";
242
                    $results[] = "to release an env reserved by someone else.";
243
                }
244
            }
245
        }
246