Code Duplication    Length = 10-10 lines in 2 locations

src/Stringy.php 2 locations

@@ 487-496 (lines=10) @@
484
   *
485
   * @return static <p>Object with its $str prefixed by the $substring.</p>
486
   */
487
  public function ensureLeft($substring)
488
  {
489
    $stringy = static::create($this->str, $this->encoding);
490
491
    if (!$stringy->startsWith($substring)) {
492
      $stringy->str = $substring . $stringy->str;
493
    }
494
495
    return $stringy;
496
  }
497
498
  /**
499
   * Returns true if the string begins with $substring, false otherwise. By
@@ 552-561 (lines=10) @@
549
   *
550
   * @return static <p>Object with its $str suffixed by the $substring.</p>
551
   */
552
  public function ensureRight($substring)
553
  {
554
    $stringy = static::create($this->str, $this->encoding);
555
556
    if (!$stringy->endsWith($substring)) {
557
      $stringy->str .= $substring;
558
    }
559
560
    return $stringy;
561
  }
562
563
  /**
564
   * Returns true if the string ends with $substring, false otherwise. By