Code Duplication    Length = 13-15 lines in 2 locations

src/StrObj.php 1 location

@@ 176-188 (lines=13) @@
173
        return $this->raw;
174
    }
175
176
    public function toArray($delim = '', $limit = null)
177
    {
178
        if (empty($delim)) {
179
            return \str_split($this->raw);
180
        }
181
        if (is_int($delim)) {
182
            return \str_split($this->raw, $delim);
183
        }
184
        if ($limit === null) {
185
            return \explode($delim, $this->raw);
186
        }
187
        return \explode($delim, $this->raw, $limit);
188
    }
189
190
    // INFORMATIONAL METHODS
191

src/UStrObj.php 1 location

@@ 57-71 (lines=15) @@
54
        parent::__construct($thing);
55
    }
56
57
    public function toArray($delim = '', $limit = null)
58
    {
59
        $this->loadToArray();
60
61
        if (empty($delim)) {
62
            return $this->chars;
63
        }
64
        if (is_int($delim)) {
65
            return \str_split($this->raw, $delim);
66
        }
67
        if ($limit === null) {
68
            return \explode($delim, $this->raw);
69
        }
70
        return \explode($delim, $this->raw, $limit);
71
    }
72
73
    public function charAt($index)
74
    {