Format code using php-cs-fixer

This commit is contained in:
jo 2021-10-11 16:10:47 +02:00
parent 43d7dc92cd
commit d52c6184b9
352 changed files with 17473 additions and 17041 deletions

View file

@ -2,7 +2,6 @@
class Application_Model_Dashboard
{
public static function GetPreviousItem($p_timeNow)
{
//get previous show and previous item in the schedule table.
@ -16,35 +15,32 @@ class Application_Model_Dashboard
if (is_null($showInstance)) {
if (count($row) == 0) {
return null;
} else {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
}
}
} else {
if (count($row) == 0) {
if ($showInstance->isRecorded()) {
//last item is a show instance
return array("name"=>$showInstance->getName(),
"starts"=>$showInstance->getShowInstanceStart(),
"ends"=>$showInstance->getShowInstanceEnd());
} else {
return null;
}
} else {
//return the one that started later.
if ($row[0]["starts"] >= $showInstance->getShowInstanceStart()) {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
} else {
return array("name"=>$showInstance->getName(),
"starts"=>$showInstance->getShowInstanceStart(),
"ends"=>$showInstance->getShowInstanceEnd());
}
}
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'], ];
}
if (count($row) == 0) {
if ($showInstance->isRecorded()) {
//last item is a show instance
return ['name' => $showInstance->getName(),
'starts' => $showInstance->getShowInstanceStart(),
'ends' => $showInstance->getShowInstanceEnd(), ];
}
return null;
}
//return the one that started later.
if ($row[0]['starts'] >= $showInstance->getShowInstanceStart()) {
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'], ];
}
return ['name' => $showInstance->getName(),
'starts' => $showInstance->getShowInstanceStart(),
'ends' => $showInstance->getShowInstanceEnd(), ];
}
public static function GetCurrentItem($p_timeNow)
@ -54,7 +50,7 @@ class Application_Model_Dashboard
//after the last item in the schedule table, then return the show's
//name. Else return the last item from the schedule.
$row = array();
$row = [];
$showInstance = Application_Model_ShowInstance::GetCurrentShowInstance($p_timeNow);
if (!is_null($showInstance)) {
$instanceId = $showInstance->getShowInstanceId();
@ -63,38 +59,36 @@ class Application_Model_Dashboard
if (is_null($showInstance)) {
if (count($row) == 0) {
return null;
} else {
/* Should never reach here, but lets return the track information
* just in case we allow tracks to be scheduled without a show
* in the future.
*/
}
/* Should never reach here, but lets return the track information
* just in case we allow tracks to be scheduled without a show
* in the future.
*/
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
}
} else {
if (count($row) == 0) {
//last item is a show instance
if ($showInstance->isRecorded()) {
return array("name"=>$showInstance->getName(),
"starts"=>$showInstance->getShowInstanceStart(),
"ends"=>$showInstance->getShowInstanceEnd(),
"media_item_played"=>false,
"record"=>true);
} else {
return null;
}
} else {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"],
"media_item_played"=>$row[0]["media_item_played"],
"record"=>0);
}
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'artwork_data' => $row[0]['artwork_data'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'], ];
}
if (count($row) == 0) {
//last item is a show instance
if ($showInstance->isRecorded()) {
return ['name' => $showInstance->getName(),
'starts' => $showInstance->getShowInstanceStart(),
'ends' => $showInstance->getShowInstanceEnd(),
'media_item_played' => false,
'record' => true, ];
}
return null;
}
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'artwork_data' => $row[0]['artwork_data'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'],
'media_item_played' => $row[0]['media_item_played'],
'record' => 0, ];
}
public static function GetNextItem($p_timeNow)
@ -110,37 +104,34 @@ class Application_Model_Dashboard
if (is_null($showInstance)) {
if (count($row) == 0) {
return null;
} else {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
}
} else {
if (count($row) == 0) {
if ($showInstance->isRecorded()) {
//last item is a show instance
return array("name"=>$showInstance->getName(),
"starts"=>$showInstance->getShowInstanceStart(),
"ends"=>$showInstance->getShowInstanceEnd());
} else {
return null;
}
} else {
//return the one that starts sooner.
if ($row[0]["starts"] <= $showInstance->getShowInstanceStart()) {
return array("name"=>$row[0]["artist_name"]." - ".$row[0]["track_title"],
"artwork_data"=>$row[0]["artwork_data"],
"starts"=>$row[0]["starts"],
"ends"=>$row[0]["ends"]);
} else {
return array("name"=>$showInstance->getName(),
"starts"=>$showInstance->getShowInstanceStart(),
"ends"=>$showInstance->getShowInstanceEnd());
}
}
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'artwork_data' => $row[0]['artwork_data'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'], ];
}
}
if (count($row) == 0) {
if ($showInstance->isRecorded()) {
//last item is a show instance
return ['name' => $showInstance->getName(),
'starts' => $showInstance->getShowInstanceStart(),
'ends' => $showInstance->getShowInstanceEnd(), ];
}
return null;
}
//return the one that starts sooner.
if ($row[0]['starts'] <= $showInstance->getShowInstanceStart()) {
return ['name' => $row[0]['artist_name'] . ' - ' . $row[0]['track_title'],
'artwork_data' => $row[0]['artwork_data'],
'starts' => $row[0]['starts'],
'ends' => $row[0]['ends'], ];
}
return ['name' => $showInstance->getName(),
'starts' => $showInstance->getShowInstanceStart(),
'ends' => $showInstance->getShowInstanceEnd(), ];
}
}