@@ -1982,7 +1982,7 @@ function getAppActiveBrowseCategories() {
1982
1982
$ thisId = $ categoryInformation ->textId . '_ ' . $ savedSearch ['id ' ];
1983
1983
$ savedSearchResults = $ this ->getAppBrowseCategoryResults ($ thisId , $ appUser , 12 , true );
1984
1984
$ formattedSavedSearchResults = [];
1985
- if (count ($ savedSearchResults ) > 0 ) {
1985
+ if (! empty ($ savedSearchResults )) {
1986
1986
foreach ($ savedSearchResults as $ savedSearchResult ) {
1987
1987
$ formattedSavedSearchResults [] = [
1988
1988
'id ' => $ savedSearchResult ['id ' ],
@@ -2010,7 +2010,7 @@ function getAppActiveBrowseCategories() {
2010
2010
} elseif ($ categoryInformation ->textId == ("system_user_lists " )) {
2011
2011
$ userLists = $ listApi ->getUserLists ();
2012
2012
$ allUserLists = $ userLists ['lists ' ] ?? [];
2013
- if (count ($ allUserLists ) > 0 ) {
2013
+ if (! empty ($ allUserLists )) {
2014
2014
foreach ($ allUserLists as $ userList ) {
2015
2015
if ($ userList ['id ' ] != "recommendations " ) {
2016
2016
require_once ROOT_DIR . '/sys/UserLists/UserList.php ' ;
@@ -2116,7 +2116,7 @@ function getAppActiveBrowseCategories() {
2116
2116
}
2117
2117
} while ($ listEntry ->fetch () && $ count < 12 );
2118
2118
2119
- if (count ($ categoryResponse ['lists ' ]) != 0 || count ($ categoryResponse ['records ' ]) != 0 ) {
2119
+ if (! empty ($ categoryResponse ['lists ' ]) || ! empty ($ categoryResponse ['records ' ])) {
2120
2120
$ formattedCategories [] = $ categoryResponse ;
2121
2121
$ numCategoriesProcessed ++;
2122
2122
if ($ maxCategories > 0 && $ numCategoriesProcessed >= $ maxCategories ) {
@@ -2144,7 +2144,7 @@ function getAppActiveBrowseCategories() {
2144
2144
'records ' => [],
2145
2145
];
2146
2146
2147
- if (count ($ suggestions ) > 0 ) {
2147
+ if (! empty ($ suggestions )) {
2148
2148
foreach ($ suggestions as $ suggestion ) {
2149
2149
$ categoryResponse ['records ' ][] = [
2150
2150
'id ' => $ suggestion ['titleInfo ' ]['id ' ],
@@ -2160,10 +2160,10 @@ function getAppActiveBrowseCategories() {
2160
2160
}
2161
2161
} elseif ($ categoryInformation ->source == 'Events ' ) {
2162
2162
$ subCategories = $ categoryInformation ->getSubCategories ();
2163
- if (count ($ subCategories ) == 0 && !$ categoryInformation ->isDismissed ($ appUser )) {
2163
+ if (empty ($ subCategories ) && !$ categoryInformation ->isDismissed ($ appUser )) {
2164
2164
$ eventsSearchResults = $ this ->getAppBrowseCategoryResults ($ categoryInformation ->textId , null , 12 , true );
2165
2165
$ formattedEventsResults = [];
2166
- if (count ($ eventsSearchResults ) > 0 ) {
2166
+ if (! empty ($ eventsSearchResults )) {
2167
2167
foreach ($ eventsSearchResults as $ event ) {
2168
2168
$ formattedEventsResults [] = [
2169
2169
'id ' => $ event ['key ' ],
@@ -2186,15 +2186,15 @@ function getAppActiveBrowseCategories() {
2186
2186
$ numCategoriesProcessed ++;
2187
2187
}
2188
2188
if ($ includeSubCategories ) {
2189
- if (count ($ subCategories ) > 0 ) {
2189
+ if (! empty ($ subCategories )) {
2190
2190
foreach ($ subCategories as $ subCategory ) {
2191
2191
$ temp = new BrowseCategory ();
2192
2192
$ temp ->id = $ subCategory ->subCategoryId ;
2193
2193
if ($ temp ->find (true )) {
2194
2194
if ($ temp ->isValidForDisplay ($ appUser )) {
2195
2195
if ($ temp ->source != '' ) {
2196
2196
$ records = $ this ->getAppBrowseCategoryResults ($ temp ->textId , null , 12 , true );
2197
- if (count ($ records ) > 0 ) {
2197
+ if (! empty ($ records )) {
2198
2198
$ parent = new BrowseCategory ();
2199
2199
$ parent ->id = $ subCategory ->browseCategoryId ;
2200
2200
if ($ parent ->find (true )) {
@@ -2230,9 +2230,9 @@ function getAppActiveBrowseCategories() {
2230
2230
}
2231
2231
} else {
2232
2232
$ subCategories = $ categoryInformation ->getSubCategories ();
2233
- if (count ($ subCategories ) == 0 && !$ categoryInformation ->isDismissed ($ appUser )) {
2233
+ if (empty ($ subCategories ) && !$ categoryInformation ->isDismissed ($ appUser )) {
2234
2234
$ records = $ this ->getAppBrowseCategoryResults ($ categoryInformation ->textId , null , 12 , true );
2235
- if (count ($ records ) > 0 ) {
2235
+ if (! empty ($ records )) {
2236
2236
$ categoryResponse = [
2237
2237
'key ' => $ categoryInformation ->textId ,
2238
2238
'title ' => $ categoryInformation ->label ,
@@ -2247,15 +2247,15 @@ function getAppActiveBrowseCategories() {
2247
2247
}
2248
2248
}
2249
2249
if ($ includeSubCategories ) {
2250
- if (count ($ subCategories ) > 0 ) {
2250
+ if (! empty ($ subCategories )) {
2251
2251
foreach ($ subCategories as $ subCategory ) {
2252
2252
$ temp = new BrowseCategory ();
2253
2253
$ temp ->id = $ subCategory ->subCategoryId ;
2254
2254
if ($ temp ->find (true )) {
2255
2255
if ($ temp ->isValidForDisplay ($ appUser )) {
2256
2256
if ($ temp ->source != '' ) {
2257
2257
$ records = $ this ->getAppBrowseCategoryResults ($ temp ->textId , null , 12 , true );
2258
- if (count ($ records ) > 0 ) {
2258
+ if (! empty ($ records )) {
2259
2259
$ parent = new BrowseCategory ();
2260
2260
$ parent ->id = $ subCategory ->browseCategoryId ;
2261
2261
if ($ parent ->find (true )) {
0 commit comments