Skip to content

Commit 5559996

Browse files
committed
fixed code in readme
1 parent 811949b commit 5559996

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,33 +161,33 @@ $info = Embed::create($url, [
161161

162162
## The dispatcher
163163

164-
To dispatch the http request, Embed has the interface `Embed\Http\DispatcherInterface`. By default the curl library is used but you can create your own dispatcher to use any other library like [guzzle](https://github.com/guzzle/guzzle):
164+
To dispatch the http request, Embed includes the interface `Embed\Http\DispatcherInterface`. By default the curl library is used but you can create your own dispatcher to use any other library like [guzzle](https://github.com/guzzle/guzzle):
165165

166166
```php
167167
use Embed\Embed;
168168
use Embed\Http\DispatcherInteface;
169-
use Embed\Http\Uri;
169+
use Embed\Http\Url;
170170
use Embed\Http\Response;
171171
use Embed\Http\ImageResponse;
172172

173173
class MyDispatcher implements DispatcherInterface
174174
{
175-
public function dispatch(Uri $uri)
175+
public function dispatch(Url $url)
176176
{
177-
$result = function_to_execute_request($uri);
177+
$result = function_to_execute_request($url);
178178

179-
return new Response($uri, $result['uri'], $result['status'], $result['type'], $result['content'], $result['headers']);
179+
return new Response($url, $result['url'], $result['status'], $result['type'], $result['content'], $result['headers']);
180180
}
181181

182-
public function dispatchImages(array $uris)
182+
public function dispatchImages(array $urls)
183183
{
184184
$responses = [];
185185

186-
foreach ($uris as $uri) {
187-
$result = function_to_get_image_size($uri);
186+
foreach ($urls as $url) {
187+
$result = function_to_get_image_size($url);
188188

189189
if ($result) {
190-
$responses[] = new ImageResponse($uri, $result['uri'], $result['status'], $result['type'], $result['size'], $result['headers']);
190+
$responses[] = new ImageResponse($url, $result['url'], $result['status'], $result['type'], $result['size'], $result['headers']);
191191
}
192192
}
193193

0 commit comments

Comments
 (0)