Skip to content

Commit eb8dba8

Browse files
committed
Don't use native union type
1 parent f4ca761 commit eb8dba8

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/Tmdb/Repository/TvSeasonRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TvSeasonRepository extends AbstractRepository
4545
* @return null|AbstractModel
4646
* @throws RuntimeException
4747
*/
48-
public function load(int|Tv $tvShow, int|Season $season, array $parameters = [], array $headers = [])
48+
public function load($tvShow, $season, array $parameters = [], array $headers = [])
4949
{
5050
if ($tvShow instanceof Tv) {
5151
$tvShow = $tvShow->getId();

test/Tmdb/Tests/Repository/TvSeasonRepositoryTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
use Tmdb\Exception\RuntimeException;
1818
use Tmdb\Model\Tv;
19-
use TypeError;
2019

2120
class TvSeasonRepositoryTest extends TestCase
2221
{
@@ -126,7 +125,7 @@ public function shouldGetVideos()
126125
*/
127126
public function shouldThrowExceptionWhenConditionsNotMet()
128127
{
129-
$this->expectException(TypeError::class);
128+
$this->expectException(RuntimeException::class);
130129
$repository = $this->getRepositoryWithMockedHttpClient();
131130

132131
$tv = new Tv();
@@ -140,7 +139,7 @@ public function shouldThrowExceptionWhenConditionsNotMet()
140139
*/
141140
public function shouldThrowExceptionWhenConditionsNotMetAll()
142141
{
143-
$this->expectException(TypeError::class);
142+
$this->expectException(RuntimeException::class);
144143
$repository = $this->getRepositoryWithMockedHttpClient();
145144
$repository->load(null, null);
146145
}

0 commit comments

Comments
 (0)