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

@@ 81-95 (lines=15) @@
78
        $this->uhandler = $uhandler;
79
    }
80
81
    public function toArray($delim = '', $limit = null)
82
    {
83
        $this->loadToArray();
84
85
        if (empty($delim)) {
86
            return $this->chars;
87
        }
88
        if (is_int($delim)) {
89
            return \str_split($this->raw, $delim);
90
        }
91
        if ($limit === null) {
92
            return \explode($delim, $this->raw);
93
        }
94
        return \explode($delim, $this->raw, $limit);
95
    }
96
97
    public function charAt($index)
98
    {