Code Duplication    Length = 12-13 lines in 2 locations

src/Url/CUrl.php 2 locations

@@ 139-151 (lines=13) @@
136
     */
137
    public function createRelative($uri = null)
138
    {
139
        if (empty($uri)) {
140
            // Empty uri means baseurl
141
            return $this->baseUrl;
142
        } elseif (substr($uri, 0, 7) == "http://"
143
            || substr($uri, 0, 8) == "https://"
144
            || substr($uri, 0, 2) == "//"
145
        ) {
146
            // Fully qualified, just leave as is.
147
            return rtrim($uri, '/');
148
        } elseif ($uri[0] == '/') {
149
            // Absolute url, prepend with siteUrl
150
            return rtrim($this->siteUrl . rtrim($uri, '/'), '/');
151
        }
152
153
        $uri = rtrim($uri, '/');
154
        return $this->baseUrl . '/' . $uri;
@@ 168-179 (lines=12) @@
165
     */
166
    public function asset($uri = null)
167
    {
168
        if (empty($uri)) {
169
            // Allow empty
170
        } elseif (substr($uri, 0, 7) == "http://"
171
            || substr($uri, 0, 8) == "https://"
172
            || substr($uri, 0, 2) == "//"
173
        ) {
174
            // Fully qualified, just leave as is.
175
            return rtrim($uri, '/');
176
        } elseif ($uri[0] == '/') {
177
            // Absolute url, prepend with staticSiteUrl
178
            return rtrim($this->staticSiteUrl . rtrim($uri, '/'), '/');
179
        }
180
181
        $baseUrl = isset($this->staticBaseUrl)
182
            ? $this->staticBaseUrl