File tree 1 file changed +8
-6
lines changed
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)
76
76
$ class ->random = htmlspecialchars (self ::get_random_string ());
77
77
}
78
78
79
- public static function get_random_string (){
79
+ public static function get_random_string ()
80
+ {
80
81
$ config = Helper::options ()->plugin ('RandomDescription ' );
81
- if (empty ($ config ->description )){
82
+ if (empty ($ config ->description )) {
82
83
return Helper::options ()->description ;
83
84
}
84
- if (time () - $ config ->last_time > $ config ->interval ){
85
+ if (time () - $ config ->last_time > $ config ->interval ) {
85
86
$ string = self ::gen_string_from ($ config ->description );
86
87
$ time = array ('last_time ' => time (), 'last_string ' => $ string );
87
88
Helper::configPlugin ('RandomDescription ' , $ time );
88
89
return $ string ;
89
- }else {
90
+ } else {
90
91
return $ config ->last_string ;
91
92
}
92
93
}
93
94
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 );
96
98
$ key = array_rand ($ str_array );
97
99
return $ str_array [$ key ];
98
100
}
You can’t perform that action at this time.
0 commit comments