File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -76,23 +76,25 @@ public static function change_description($class)
7676 $ class ->random = htmlspecialchars (self ::get_random_string ());
7777 }
7878
79- public static function get_random_string (){
79+ public static function get_random_string ()
80+ {
8081 $ config = Helper::options ()->plugin ('RandomDescription ' );
81- if (empty ($ config ->description )){
82+ if (empty ($ config ->description )) {
8283 return Helper::options ()->description ;
8384 }
84- if (time () - $ config ->last_time > $ config ->interval ){
85+ if (time () - $ config ->last_time > $ config ->interval ) {
8586 $ string = self ::gen_string_from ($ config ->description );
8687 $ time = array ('last_time ' => time (), 'last_string ' => $ string );
8788 Helper::configPlugin ('RandomDescription ' , $ time );
8889 return $ string ;
89- }else {
90+ } else {
9091 return $ config ->last_string ;
9192 }
9293 }
9394
94- public static function gen_string_from ($ description ){
95- $ str_array = explode ("\n" ,$ description );
95+ public static function gen_string_from ($ description )
96+ {
97+ $ str_array = explode ("\n" , $ description );
9698 $ key = array_rand ($ str_array );
9799 return $ str_array [$ key ];
98100 }
You can’t perform that action at this time.
0 commit comments