Code Duplication    Length = 7-7 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4313-4319 (lines=7) @@
4310
      return null;
4311
    }
4312
4313
    if ($offset || $length !== null) {
4314
      $strTmp = self::substr($str, $offset, $length);
4315
      if ($strTmp === false) {
4316
        return null;
4317
      }
4318
      $str = (string)$strTmp;
4319
    }
4320
4321
    if (!isset($str[0])) {
4322
      return null;
@@ 5174-5180 (lines=7) @@
5171
   */
5172
  public static function strspn(string $str, string $mask, int $offset = 0, int $length = null): int
5173
  {
5174
    if ($offset || $length !== null) {
5175
      $strTmp = self::substr($str, $offset, $length);
5176
      if ($strTmp === false) {
5177
        $strTmp = '';
5178
      }
5179
      $str = (string)$strTmp;
5180
    }
5181
5182
    if (!isset($str[0], $mask[0])) {
5183
      return 0;