Format code using php-cs-fixer
This commit is contained in:
parent
43d7dc92cd
commit
d52c6184b9
352 changed files with 17473 additions and 17041 deletions
|
@ -2,19 +2,18 @@
|
|||
|
||||
class Application_Model_Library
|
||||
{
|
||||
|
||||
public static function getObjInfo($p_type)
|
||||
{
|
||||
$info = array();
|
||||
$info = [];
|
||||
|
||||
if (strcmp($p_type, 'playlist')==0) {
|
||||
if (strcmp($p_type, 'playlist') == 0) {
|
||||
$info['className'] = 'Application_Model_Playlist';
|
||||
} elseif (strcmp($p_type, 'block')==0) {
|
||||
} elseif (strcmp($p_type, 'block') == 0) {
|
||||
$info['className'] = 'Application_Model_Block';
|
||||
} elseif (strcmp($p_type, 'webstream')==0) {
|
||||
} elseif (strcmp($p_type, 'webstream') == 0) {
|
||||
$info['className'] = 'Application_Model_Webstream';
|
||||
} else {
|
||||
throw new Exception("Unknown object type: '$p_type'");
|
||||
throw new Exception("Unknown object type: '{$p_type}'");
|
||||
}
|
||||
|
||||
return $info;
|
||||
|
@ -25,8 +24,7 @@ class Application_Model_Library
|
|||
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
|
||||
if (is_null($p_id) || is_null($p_type)) {
|
||||
unset($obj_sess->id);
|
||||
unset($obj_sess->type);
|
||||
unset($obj_sess->id, $obj_sess->type);
|
||||
} else {
|
||||
$obj_sess->id = intval($p_id);
|
||||
$obj_sess->type = $p_type;
|
||||
|
@ -35,20 +33,19 @@ class Application_Model_Library
|
|||
|
||||
public static function getPlaylistNames($alphasort = false)
|
||||
{
|
||||
|
||||
$playlistNames = array(NULL => _("None"));
|
||||
$playlistNames = [null => _('None')];
|
||||
//if we want to return the playlists sorted alphabetically by name
|
||||
if ($alphasort) {
|
||||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->orderByname()
|
||||
->find();
|
||||
|
||||
}
|
||||
else {
|
||||
->find()
|
||||
;
|
||||
} else {
|
||||
$playlists = CcPlaylistQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
->find();
|
||||
->find()
|
||||
;
|
||||
}
|
||||
foreach ($playlists as $playlist) {
|
||||
$playlistNames[$playlist->getDbId()] = $playlist->getDbName();
|
||||
|
@ -59,13 +56,13 @@ class Application_Model_Library
|
|||
|
||||
public static function getTracktypes()
|
||||
{
|
||||
$track_type_options = array(NULL => _("None"));
|
||||
$track_type_options = [null => _('None')];
|
||||
$track_types = Application_Model_Tracktype::getTracktypes();
|
||||
|
||||
array_multisort(array_map(function($element) {
|
||||
|
||||
array_multisort(array_map(function ($element) {
|
||||
return $element['type_name'];
|
||||
}, $track_types), SORT_ASC, $track_types);
|
||||
|
||||
|
||||
foreach ($track_types as $key => $tt) {
|
||||
$track_type_options[$tt['code']] = $tt['type_name'];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue