Skip to content

Commit 7d711a1

Browse files
committed
Merge pull request #72 from wtfzdotnet/config-issue
Fixing configuration issue.
2 parents 19f6dde + 52bd3bf commit 7d711a1

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed

lib/Tmdb/Client.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ protected function configureOptions(array $options)
209209
'token' => null,
210210
'session_token' => null,
211211
'event_dispatcher' => array_key_exists('event_dispatcher', $this->options) ? $this->options['event_dispatcher'] : new EventDispatcher(),
212-
'cache' => $this->configureCacheOptions($options),
213-
'log' => $this->configureLogOptions($options),
212+
'cache' => [],
213+
'log' => [],
214214
]);
215215

216216
$resolver->setNormalizer('base_url', function ($options, $value) {
@@ -237,8 +237,6 @@ protected function configureOptions(array $options)
237237
$resolver->setAllowedTypes('token', 'object');
238238
$resolver->setAllowedTypes('session_token', ['object', 'null']);
239239
$resolver->setAllowedTypes('event_dispatcher', 'object');
240-
$resolver->setAllowedTypes('cache', 'array');
241-
$resolver->setAllowedTypes('log', 'array');
242240

243241
$this->options = $resolver->resolve($options);
244242

@@ -248,6 +246,9 @@ protected function configureOptions(array $options)
248246
);
249247
}
250248

249+
$this->options['cache'] = $this->configureCacheOptions($options);
250+
$this->options['log'] = $this->configureLogOptions($options);
251+
251252
return $this->options;
252253
}
253254

lib/Tmdb/Repository/AccountRepository.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ public function favorite($accountId, $media, $isFavorite = true, $mediaType = 'm
113113
* @param array $parameters
114114
* @param array $headers
115115
* @return ResultCollection
116-
*
117-
* @todo Include the user rating
118116
*/
119117
public function getRatedMovies($accountId, array $parameters = [], array $headers = [])
120118
{
@@ -130,8 +128,6 @@ public function getRatedMovies($accountId, array $parameters = [], array $header
130128
* @param array $parameters
131129
* @param array $headers
132130
* @return ResultCollection
133-
*
134-
* @todo Include the user rating
135131
*/
136132
public function getRatedTvShows($accountId, array $parameters = [], array $headers = [])
137133
{

lib/Tmdb/Repository/PeopleRepository.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
* @package Tmdb\Repository
2323
* @see http://docs.themoviedb.apiary.io/#people
2424
*
25-
* @todo implement the new methods
2625
*/
2726
class PeopleRepository extends AbstractRepository
2827
{

test/Tmdb/Tests/ClientTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,12 @@ public function testShouldSwitchHttpScheme()
107107
}
108108

109109
/**
110-
* @todo
110+
* @test
111111
*/
112112
public function shouldAddCachePluginWhenEnabled()
113113
{
114114
$token = new ApiToken(self::API_TOKEN);
115115
$client = new Client($token);
116-
$client->setCaching(true, '/tmp/php-tmdb-api');
117116

118117
$listeners = $client->getHttpClient()->getAdapter()->getClient()
119118
->getEmitter()
@@ -126,13 +125,12 @@ public function shouldAddCachePluginWhenEnabled()
126125
}
127126

128127
/**
129-
* @todo
128+
* @test
130129
*/
131130
public function shouldAddLoggingPluginWhenEnabled()
132131
{
133132
$token = new ApiToken(self::API_TOKEN);
134-
$client = new Client($token);
135-
$client->setLogging(true, '/tmp/php-tmdb-api.log');
133+
$client = new Client($token, ['log' => ['enabled' => true]]);
136134

137135
$listeners = $client->getHttpClient()->getAdapter()->getClient()
138136
->getEmitter()

test/Tmdb/Tests/Repository/PeopleRepositoryTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
*/
1313
namespace Tmdb\Tests\Repository;
1414

15-
/**
16-
* @todo review if the rest of the methods need to be added
17-
*/
1815
class PeopleRepositoryTest extends TestCase
1916
{
2017
const PERSON_ID = 287;

0 commit comments

Comments
 (0)