Code Duplication    Length = 8-8 lines in 2 locations

src/Date.php 2 locations

@@ 2348-2355 (lines=8) @@
2345
     *
2346
     * @return static
2347
     */
2348
    public function next($dayOfWeek = null)
2349
    {
2350
        if ($dayOfWeek === null) {
2351
            $dayOfWeek = $this->getDayOfWeek();
2352
        }
2353
2354
        return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
2355
    }
2356
2357
    /**
2358
     * Modify to the previous occurrence of a given day of the week.
@@ 2367-2374 (lines=8) @@
2364
     *
2365
     * @return static
2366
     */
2367
    public function previous($dayOfWeek = null)
2368
    {
2369
        if ($dayOfWeek === null) {
2370
            $dayOfWeek = $this->getDayOfWeek();
2371
        }
2372
2373
        return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]);
2374
    }
2375
2376
    /**
2377
     * Modify to the first occurrence of a given day of the week