Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Fix compatibility with php 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
joserick committed Mar 26, 2019
1 parent 822308f commit c4fcf96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Plex.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ public function registerServers(array $servers)

// We are going to use the first server in the list to get a list of the
// availalble clients and register those automatically.
$serverName = reset(array_keys(self::$servers));
$serverKeys = array_keys(self::$servers);
$serverName = reset($serverKeys);
$this->registerClients(
$this->getServer($serverName)->getClients()
);
Expand Down
18 changes: 9 additions & 9 deletions Server/Library/SectionAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,15 +529,14 @@ protected function getPolymorphicItem($polymorphicData, $scopedToItem = FALSE)
{
if (is_int($polymorphicData)) {
// If we have an integer then we can assume we have a rating key.
if ($item = reset(
$this->getItems(
sprintf(
'%s/%d',
Plex_Server_Library::ENDPOINT_METADATA,
$polymorphicData
)
$item = $this->getItems(
sprintf(
'%s/%d',
Plex_Server_Library::ENDPOINT_METADATA,
$polymorphicData
)
)) {
);
if ($item = reset($item)) {
return $item;
}

Expand All @@ -562,7 +561,8 @@ protected function getPolymorphicItem($polymorphicData, $scopedToItem = FALSE)
$polymorphicData
);

if ($item = reset($this->getItems($endpoint))) {
$item = $this->getItems($endpoint);
if ($item = reset($item)) {
return $item;
}

Expand Down

0 comments on commit c4fcf96

Please sign in to comment.