Skip to content

Commit a061943

Browse files
committed
Update documentation
1 parent c3f0be7 commit a061943

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

README.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $options = array(
3636
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
3737
);
3838

39-
$client = new \Stevenmaguire\Yelp\ClientFactory::makeWith(
39+
$client = \Stevenmaguire\Yelp\ClientFactory::makeWith(
4040
$options,
4141
\Stevenmaguire\Yelp\Version::TWO
4242
);
@@ -50,7 +50,7 @@ $options = array(
5050
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
5151
);
5252

53-
$client = new \Stevenmaguire\Yelp\ClientFactory::makeWith(
53+
$client = \Stevenmaguire\Yelp\ClientFactory::makeWith(
5454
$options,
5555
\Stevenmaguire\Yelp\Version::THREE
5656
);
@@ -102,35 +102,27 @@ echo $response->getBody();
102102
## Upgrading with Yelp API v2 support from `yelp-php 1.x` to `yelp-php 2.x`
103103

104104
```php
105-
// yelp-php 1.x
106-
$client = new Stevenmaguire\Yelp\Client(array(
105+
// same options for all
106+
$options = array(
107107
'consumerKey' => 'YOUR COSUMER KEY',
108108
'consumerSecret' => 'YOUR CONSUMER SECRET',
109109
'token' => 'YOUR TOKEN',
110110
'tokenSecret' => 'YOUR TOKEN SECRET',
111111
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
112-
));
112+
);
113+
114+
115+
// yelp-php 1.x
116+
$client = new Stevenmaguire\Yelp\Client($options);
113117

114118
// yelp-php 2.x - option 1
115-
$client = new \Stevenmaguire\Yelp\ClientFactory::makeWith(
116-
array(
117-
'consumerKey' => 'YOUR COSUMER KEY',
118-
'consumerSecret' => 'YOUR CONSUMER SECRET',
119-
'token' => 'YOUR TOKEN',
120-
'tokenSecret' => 'YOUR TOKEN SECRET',
121-
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
122-
),
119+
$client = \Stevenmaguire\Yelp\ClientFactory::makeWith(
120+
$options,
123121
\Stevenmaguire\Yelp\Version::TWO
124122
);
125123

126124
// yelp-php 2.x - option 2
127-
$client = new \Stevenmaguire\Yelp\v2\Client(array(
128-
'consumerKey' => 'YOUR COSUMER KEY',
129-
'consumerSecret' => 'YOUR CONSUMER SECRET',
130-
'token' => 'YOUR TOKEN',
131-
'tokenSecret' => 'YOUR TOKEN SECRET',
132-
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
133-
));
125+
$client = new \Stevenmaguire\Yelp\v2\Client($options);
134126
```
135127

136128
## Testing

0 commit comments

Comments
 (0)