Code Duplication    Length = 7-7 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 5385-5391 (lines=7) @@
5382
      return null;
5383
    }
5384
5385
    if ($offset || $length !== null) {
5386
      $strTmp = self::substr($str, $offset, $length);
5387
      if ($strTmp === false) {
5388
        return null;
5389
      }
5390
      $str = (string)$strTmp;
5391
    }
5392
5393
    if (!isset($str[0])) {
5394
      return null;
@@ 6263-6269 (lines=7) @@
6260
   */
6261
  public static function strspn(string $str, string $mask, int $offset = 0, int $length = null): int
6262
  {
6263
    if ($offset || $length !== null) {
6264
      $strTmp = self::substr($str, $offset, $length);
6265
      if ($strTmp === false) {
6266
        $strTmp = '';
6267
      }
6268
      $str = (string)$strTmp;
6269
    }
6270
6271
    if (!isset($str[0], $mask[0])) {
6272
      return 0;