Code Duplication    Length = 17-20 lines in 2 locations

src/Pinterest/Api.php 2 locations

@@ 446-465 (lines=20) @@
443
     *
444
     * @throws RateLimitedReached
445
     */
446
    public function followBoard($username, $boardName)
447
    {
448
        if (empty($username)) {
449
            throw new InvalidArgumentException('Username is required.');
450
        }
451
452
        if (empty($boardName)) {
453
            throw new InvalidArgumentException('The board name is required.');
454
        }
455
456
        $request = new Request(
457
            'POST',
458
            'me/following/boards/',
459
            array(
460
                'board' => "{$username}/{$boardName}",
461
            )
462
        );
463
464
        return $this->execute($request);
465
    }
466
467
    /**
468
     * Unfollow a board.
@@ 477-493 (lines=17) @@
474
     *
475
     * @throws RateLimitedReached
476
     */
477
    public function unfollowBoard($username, $boardName)
478
    {
479
        if (empty($username)) {
480
            throw new InvalidArgumentException('Username is required.');
481
        }
482
483
        if (empty($boardName)) {
484
            throw new InvalidArgumentException('The board name is required.');
485
        }
486
487
        $request = new Request(
488
            'DELETE',
489
            "me/following/boards/{$username}/{$boardName}"
490
        );
491
492
        return $this->execute($request);
493
    }
494
495
    /**
496
     * Create a board.