@@ -670,7 +670,9 @@ public function getParentCategories()
670
670
if ($ category ->getId () && $ category ->isVisibleOnStore ($ this ->getStoreId ())) {
671
671
$ this ->_parentCategories [$ categoryId ] = $ category ;
672
672
}
673
- } catch (NoSuchEntityException $ e ) { }
673
+ } catch (NoSuchEntityException $ e ) {
674
+
675
+ }
674
676
}
675
677
uasort ($ this ->_parentCategories , [$ this , 'sortByPositionDesc ' ]);
676
678
}
@@ -685,7 +687,8 @@ public function getParentCategories()
685
687
* @param $b
686
688
* @return int
687
689
*/
688
- public function sortByPositionDesc ($ a , $ b ) {
690
+ public function sortByPositionDesc ($ a , $ b )
691
+ {
689
692
return strcmp ($ b ->getPosition (), $ a ->getPosition ());
690
693
}
691
694
@@ -857,7 +860,9 @@ public function getAuthor()
857
860
if ($ _author ->getId () && $ _author ->isVisibleOnStore ($ this ->getStoreId ())) {
858
861
$ author = $ _author ;
859
862
}
860
- } catch (NoSuchEntityException $ e ) { }
863
+ } catch (NoSuchEntityException $ e ) {
864
+
865
+ }
861
866
}
862
867
$ this ->setData ('author ' , $ author );
863
868
}
@@ -1147,13 +1152,13 @@ public function getReadingTime()
1147
1152
if (!$ this ->getData ('reading_time ' )) {
1148
1153
$ wpm = 250 ;
1149
1154
$ contentHtml = $ this ->getFilteredContent ();
1150
- $ numberOfImages = substr_count ( strtolower ( $ contentHtml ), '<img ' );
1155
+ $ numberOfImages = substr_count (strtolower ($ contentHtml ), '<img ' );
1151
1156
$ additionalWordsForImages = (int )($ numberOfImages * 12 ) / $ wpm ;
1152
- $ wordCount = count (preg_split ( '/\s+/ ' , strip_tags ($ contentHtml )));
1157
+ $ wordCount = count (preg_split ('/\s+/ ' , strip_tags ($ contentHtml )));
1153
1158
1154
1159
$ readingTime = 1 ;
1155
1160
1156
- if (!$ wordCount && !$ additionalWordsForImages ){
1161
+ if (!$ wordCount && !$ additionalWordsForImages ) {
1157
1162
return $ readingTime ;
1158
1163
}
1159
1164
$ readingTime = ceil (($ wordCount + $ additionalWordsForImages ) / $ wpm );
0 commit comments