@@ -36,7 +36,7 @@ $options = array(
36
36
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
37
37
);
38
38
39
- $client = new \Stevenmaguire\Yelp\ClientFactory::makeWith(
39
+ $client = \Stevenmaguire\Yelp\ClientFactory::makeWith(
40
40
$options,
41
41
\Stevenmaguire\Yelp\Version::TWO
42
42
);
@@ -50,7 +50,7 @@ $options = array(
50
50
'apiHost' => 'api.yelp.com' // Optional, default 'api.yelp.com'
51
51
);
52
52
53
- $client = new \Stevenmaguire\Yelp\ClientFactory::makeWith(
53
+ $client = \Stevenmaguire\Yelp\ClientFactory::makeWith(
54
54
$options,
55
55
\Stevenmaguire\Yelp\Version::THREE
56
56
);
@@ -102,35 +102,27 @@ echo $response->getBody();
102
102
## Upgrading with Yelp API v2 support from ` yelp-php 1.x ` to ` yelp-php 2.x `
103
103
104
104
``` php
105
- // yelp-php 1.x
106
- $client = new Stevenmaguire\Yelp\Client( array(
105
+ // same options for all
106
+ $options = array(
107
107
'consumerKey' => 'YOUR COSUMER KEY',
108
108
'consumerSecret' => 'YOUR CONSUMER SECRET',
109
109
'token' => 'YOUR TOKEN',
110
110
'tokenSecret' => 'YOUR TOKEN SECRET',
111
111
'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);
113
117
114
118
// 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,
123
121
\Stevenmaguire\Yelp\Version::TWO
124
122
);
125
123
126
124
// 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);
134
126
```
135
127
136
128
## Testing
0 commit comments