Skip to content

Commit 1bb2c93

Browse files
committed
More fixes, also had to upgrade the event dispatcher component to resolve an deprecation issue.
1 parent 97a33c8 commit 1bb2c93

16 files changed

Lines changed: 53 additions & 51 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"require": {
1616
"php": ">=5.4.0",
1717
"ext-curl": "*",
18-
"symfony/event-dispatcher": "~2.1",
18+
"symfony/event-dispatcher": "~2.4",
1919
"symfony/options-resolver": "~2.1",
2020
"guzzlehttp/guzzle": "~5.0",
2121
"guzzlehttp/cache-subscriber": "~0.1@dev",

lib/Tmdb/ConfigurationInterface.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
7-
*
7+
*
88
* @package Shop2Market
99
* @author Michael Roterman <michael@b-found.nl>
1010
* @copyright (c) 2014, B-Found Internet Marketing & Services
@@ -13,6 +13,7 @@
1313

1414
namespace Tmdb;
1515

16-
interface ConfigurationInterface {
17-
function all();
18-
}
16+
interface ConfigurationInterface
17+
{
18+
public function all();
19+
}

lib/Tmdb/Event/HydrationSubscriber.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
namespace Tmdb\Event;
1414

15+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1516
use Tmdb\Common\ObjectHydrator;
1617
use Tmdb\HttpClient\HttpClientEventSubscriber;
1718

@@ -36,13 +37,16 @@ public static function getSubscribedEvents()
3637
/**
3738
* Hydrate the subject with data
3839
*
39-
* @param HydrationEvent $event
40+
* @param HydrationEvent $event
41+
* @param string $eventName
42+
* @param EventDispatcherInterface $eventDispatcher
43+
*
4044
* @return \Tmdb\Model\AbstractModel
4145
*/
42-
public function hydrate(HydrationEvent $event)
46+
public function hydrate(HydrationEvent $event, $eventName, $eventDispatcher)
4347
{
4448
// Possibility to load serialized cache
45-
$event->getDispatcher()->dispatch(TmdbEvents::BEFORE_HYDRATION, $event);
49+
$eventDispatcher->dispatch(TmdbEvents::BEFORE_HYDRATION, $event);
4650

4751
if ($event->isPropagationStopped()) {
4852
return $event->getSubject();
@@ -52,7 +56,7 @@ public function hydrate(HydrationEvent $event)
5256
$event->setSubject($subject);
5357

5458
// Possibility to cache the data
55-
$event->getDispatcher()->dispatch(TmdbEvents::AFTER_HYDRATION, $event);
59+
$eventDispatcher->dispatch(TmdbEvents::AFTER_HYDRATION, $event);
5660

5761
return $event->getSubject();
5862
}

lib/Tmdb/Event/RequestSubscriber.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
namespace Tmdb\Event;
1414

15+
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1516
use Tmdb\Exception\RuntimeException;
1617
use Tmdb\HttpClient\HttpClientEventSubscriber;
1718
use Tmdb\HttpClient\Response;
@@ -29,10 +30,17 @@ public static function getSubscribedEvents()
2930
];
3031
}
3132

32-
public function send(RequestEvent $event)
33+
/**
34+
* @param RequestEvent $event
35+
* @param string $eventName
36+
* @param EventDispatcherInterface $eventDispatcher
37+
*
38+
* @return string|Response
39+
*/
40+
public function send(RequestEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
3341
{
3442
// Preparation of request parameters / Possibility to use for logging and caching etc.
35-
$event->getDispatcher()->dispatch(TmdbEvents::BEFORE_REQUEST, $event);
43+
$eventDispatcher->dispatch(TmdbEvents::BEFORE_REQUEST, $event);
3644

3745
if ($event->isPropagationStopped() && $event->hasResponse()) {
3846
return $event->getResponse();
@@ -42,7 +50,7 @@ public function send(RequestEvent $event)
4250
$event->setResponse($response);
4351

4452
// Possibility to cache the request
45-
$event->getDispatcher()->dispatch(TmdbEvents::AFTER_REQUEST, $event);
53+
$eventDispatcher->dispatch(TmdbEvents::AFTER_REQUEST, $event);
4654

4755
return $response;
4856
}

lib/Tmdb/Exception/TmdbApiException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class TmdbApiException extends \Exception
4343
/**
4444
* Create the exception
4545
*
46-
* @param string $message
47-
* @param int $code
48-
* @param null $request
49-
* @param null $response
46+
* @param string $message
47+
* @param int $code
48+
* @param Request|null $request
49+
* @param Response|null $response
5050
*/
5151
public function __construct($code, $message, $request = null, $response = null)
5252
{

lib/Tmdb/Factory/FindFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(HttpClient $httpClient)
5656
$this->movieFactory = new MovieFactory($httpClient);
5757
$this->peopleFactory = new PeopleFactory($httpClient);
5858
$this->tvFactory = new TvFactory($httpClient);
59-
$this->tvSeasonFactory = new TvFactory($httpClient);
59+
$this->tvSeasonFactory = new TvSeasonFactory($httpClient);
6060
$this->tvEpisodeFactory = new TvEpisodeFactory($httpClient);
6161

6262
parent::__construct($httpClient);
@@ -181,15 +181,15 @@ public function setTvEpisodeFactory($tvEpisodeFactory)
181181
}
182182

183183
/**
184-
* @return TvFactory
184+
* @return TvSeasonFactory
185185
*/
186186
public function getTvSeasonFactory()
187187
{
188188
return $this->tvSeasonFactory;
189189
}
190190

191191
/**
192-
* @param TvFactory $tvSeasonFactory
192+
* @param TvSeasonFactory $tvSeasonFactory
193193
* @return $this
194194
*/
195195
public function setTvSeasonFactory($tvSeasonFactory)

lib/Tmdb/HttpClient/HttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ public function delete($path, $body = null, array $parameters = [], array $heade
148148
}
149149

150150
/**
151-
* @return ParameterBag
151+
* @return array
152152
*/
153153
public function getOptions()
154154
{
155155
return $this->options;
156156
}
157157

158158
/**
159-
* @param ParameterBag $options
159+
* @param array $options
160160
* @return $this
161161
*/
162162
public function setOptions($options)

lib/Tmdb/Model/Account/ListItem.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace Tmdb\Model\Account;
1414

1515
use Tmdb\Model\AbstractModel;
16+
use Tmdb\Model\Image;
1617
use Tmdb\Model\Image\PosterImage;
1718

1819
/**
@@ -214,7 +215,7 @@ public function getName()
214215
}
215216

216217
/**
217-
* @param \Tmdb\Model\Image\PosterImage $posterImage
218+
* @param PosterImage|Image $posterImage
218219
* @return $this
219220
*/
220221
public function setPosterImage($posterImage)
@@ -225,7 +226,7 @@ public function setPosterImage($posterImage)
225226
}
226227

227228
/**
228-
* @return \Tmdb\Model\Image\PosterImage
229+
* @return PosterImage|Image
229230
*/
230231
public function getPosterImage()
231232
{

lib/Tmdb/Model/Collection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct()
8383
}
8484

8585
/**
86-
* @param \Tmdb\Model\Image\BackdropImage $backdrop
86+
* @param BackdropImage $backdrop
8787
* @return $this
8888
*/
8989
public function setBackdropImage(BackdropImage $backdrop)
@@ -94,7 +94,7 @@ public function setBackdropImage(BackdropImage $backdrop)
9494
}
9595

9696
/**
97-
* @return \Tmdb\Model\Image\BackdropImage
97+
* @return BackdropImage
9898
*/
9999
public function getBackdropImage()
100100
{
@@ -216,7 +216,7 @@ public function getParts()
216216
}
217217

218218
/**
219-
* @param \Tmdb\Model\Image\PosterImage $poster
219+
* @param PosterImage $poster
220220
* @return $this
221221
*/
222222
public function setPosterImage(PosterImage $poster)

lib/Tmdb/Model/Common/AccountStates.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AccountStates extends AbstractModel
3131
private $favorite;
3232

3333
/**
34-
* @var Rating
34+
* @var Rating|boolean
3535
*/
3636
private $rated;
3737

@@ -93,7 +93,7 @@ public function getId()
9393
}
9494

9595
/**
96-
* @param Rating $rated
96+
* @param Rating|bool $rated
9797
* @return $this
9898
*/
9999
public function setRated($rated)
@@ -104,7 +104,7 @@ public function setRated($rated)
104104
}
105105

106106
/**
107-
* @return Rating
107+
* @return Rating|bool
108108
*/
109109
public function getRated()
110110
{

0 commit comments

Comments
 (0)