Skip to content

Commit 24f36e3

Browse files
committed
Adding an ConfigurationInterface
1 parent a079408 commit 24f36e3

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

lib/Tmdb/Client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ class Client
6464
*/
6565
public function __construct(ApiToken $token, $options = [])
6666
{
67-
$this->configureOptions(array_replace(['token' => $token], $options));
67+
if ($options instanceof ConfigurationInterface) {
68+
$options = $options->all();
69+
}
70+
71+
$this->configureOptions(array_replace(['token' => $token], (array) $options));
6872
$this->constructHttpClient();
6973
}
7074

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* This file is part of the Shop2Market module created by B-Found IM&S.
4+
*
5+
* For the full copyright and license information, please view the LICENSE
6+
* file that was distributed with this source code.
7+
*
8+
* @package Shop2Market
9+
* @author Michael Roterman <michael@b-found.nl>
10+
* @copyright (c) 2014, B-Found Internet Marketing & Services
11+
* @version 0.0.1
12+
*/
13+
14+
namespace Tmdb;
15+
16+
interface ConfigurationInterface {
17+
function all();
18+
}

0 commit comments

Comments
 (0)