Skip to content

Commit b79e6e6

Browse files
committed
renamed Url::withAddedDirectory to Url::withAddedPath()
1 parent b1cb65c commit b79e6e6

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

src/Adapters/Flickr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getCode()
2929

3030
if (empty($code)) {
3131
$url = (new Url($this->request->getUrl()))
32-
->withAddedDirectory('player');
32+
->withAddedPath('player');
3333

3434
$code = Utils::iframe($url->getUrl(), $this->width, $this->height);
3535
}

src/Url.php

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,26 +205,6 @@ public function withDirectoryPosition($key, $value)
205205
return $clone;
206206
}
207207

208-
/**
209-
* Returns a clone with other directory in a specific position
210-
*
211-
* @param string $value The new value
212-
*
213-
* @return Url
214-
*/
215-
public function withAddedDirectory($value)
216-
{
217-
$clone = clone $this;
218-
219-
if (isset($clone->info['file'])) {
220-
$clone->info['path'][] = $clone->info['file'];
221-
}
222-
223-
$clone->info['file'] = $value;
224-
225-
return $clone;
226-
}
227-
228208
/**
229209
* Return all directories
230210
*
@@ -271,6 +251,20 @@ public function withPath($path)
271251
return $clone;
272252
}
273253

254+
/**
255+
* Returns a clone with path appended
256+
*
257+
* @param string $path
258+
*
259+
* @return Url
260+
*/
261+
public function withAddedPath($path)
262+
{
263+
$path = $this->getPath().'/'.$path;
264+
265+
return $this->withPath($path);
266+
}
267+
274268
/**
275269
* Check if the url has a query parameter
276270
*

0 commit comments

Comments
 (0)