Code Duplication    Length = 11-15 lines in 2 locations

src/PHPFeature.php 2 locations

@@ 304-314 (lines=11) @@
301
     * @return string Version number that meets the requirement.
302
     * @throws RuntimeException If the requirement could not be satisfied.
303
     */
304
    protected function getGreaterThanVersion($milestone)
305
    {
306
        $data = $this->releases->getAll();
307
        foreach ($data as $version => $date) {
308
            if (version_compare($version, $milestone, '>')) {
309
                return $version;
310
            }
311
        }
312
313
        throw new RuntimeException('Could not satisfy version requirements.');
314
    }
315
316
    /**
317
     * Get a version lesser than the milestone.
@@ 350-364 (lines=15) @@
347
     *
348
     * @return string Version number that meets the requirement.
349
     */
350
    protected function getGreaterEqualVersion($milestone)
351
    {
352
        if ($this->releases->exists($milestone)) {
353
            return $milestone;
354
        }
355
356
        $data = $this->releases->getAll();
357
        foreach ($data as $version => $date) {
358
            if (version_compare($version, $milestone, '>=')) {
359
                return $version;
360
            }
361
        }
362
363
        throw new RuntimeException('Could not satisfy version requirements.');
364
    }
365
366
    /**
367
     * Get a version lesser or equal than the milestone.