GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 24-24 lines in 2 locations

src/Socket.php 2 locations

@@ 447-470 (lines=24) @@
444
     *
445
     * @return int
446
     */
447
    public function write($buffer, $length = null)
448
    {
449
        if (null === $length) {
450
            $length = strlen($buffer);
451
        }
452
453
        // make sure everything is written
454
        do {
455
            $return = @socket_write($this->resource, $buffer, $length);
456
457
            if (false !== $return && $return < $length) {
458
                $buffer = substr($buffer, $return);
459
                $length -= $return;
460
            } else {
461
                break;
462
            }
463
        } while (true);
464
465
        if ($return === false) {
466
            throw new SocketException($this->resource);
467
        }
468
469
        return $return;
470
    }
471
472
    /**
473
     * Sends data to a connected socket.
@@ 483-506 (lines=24) @@
480
     *
481
     * @return int
482
     */
483
    public function send($buffer, $flags = 0, $length = null)
484
    {
485
        if (null === $length) {
486
            $length = strlen($buffer);
487
        }
488
489
        // make sure everything is written
490
        do {
491
            $return = @socket_send($this->resource, $buffer, $length, $flags);
492
493
            if (false !== $return && $return < $length) {
494
                $buffer = substr($buffer, $return);
495
                $length -= $return;
496
            } else {
497
                break;
498
            }
499
        } while (true);
500
501
        if ($return === false) {
502
            throw new SocketException($this->resource);
503
        }
504
505
        return $return;
506
    }
507
508
    /**
509
     * Set the socket to blocking / non blocking.