@@ -20,7 +20,7 @@ class StatifyBlacklist_Settings extends StatifyBlacklist {
2020 *
2121 * @return void
2222 */
23- public static function register_settings () {
23+ public static function register_settings (): void {
2424 register_setting (
2525 'statify-blacklist ' ,
2626 'statify-blacklist ' ,
@@ -166,7 +166,7 @@ public static function register_settings() {
166166 *
167167 * @return void
168168 */
169- public static function create_settings_page () {
169+ public static function create_settings_page (): void {
170170 ?>
171171 <div class="wrap">
172172 <h1><?php esc_html_e ( 'Statify Filter ' , 'statify-blacklist ' ); ?> </h1>
@@ -225,7 +225,7 @@ public static function create_settings_page() {
225225 *
226226 * @return void
227227 */
228- public static function option_referer_active () {
228+ public static function option_referer_active (): void {
229229 ?>
230230 <fieldset>
231231 <legend class="screen-reader-text"><?php esc_html_e ( 'Activate live filter ' , 'statify-blacklist ' ); ?> </legend>
@@ -245,7 +245,7 @@ public static function option_referer_active() {
245245 *
246246 * @return void
247247 */
248- public static function option_referer_cron () {
248+ public static function option_referer_cron (): void {
249249 ?>
250250 <fieldset>
251251 <legend class="screen-reader-text"><?php esc_html_e ( 'CronJob execution ' , 'statify-blacklist ' ); ?> </legend>
@@ -265,7 +265,7 @@ public static function option_referer_cron() {
265265 *
266266 * @return void
267267 */
268- public static function option_referer_regexp () {
268+ public static function option_referer_regexp (): void {
269269 ?>
270270 <select id="statifyblacklist-referer-regexp" name="statify-blacklist[referer][regexp]">
271271 <option value="<?php print esc_attr ( StatifyBlacklist::MODE_NORMAL ); ?> " <?php selected ( StatifyBlacklist::$ options ['referer ' ]['regexp ' ], StatifyBlacklist::MODE_NORMAL ); ?> >
@@ -296,7 +296,7 @@ public static function option_referer_regexp() {
296296 *
297297 * @return void
298298 */
299- public static function option_referer_blacklist () {
299+ public static function option_referer_blacklist (): void {
300300 ?>
301301 <textarea id="statifyblacklist-referer-blacklist" name="statify-blacklist[referer][blacklist]" cols="40" rows="5"><?php
302302 print esc_html ( implode ( "\r\n" , array_keys ( StatifyBlacklist::$ options ['referer ' ]['blacklist ' ] ) ) );
@@ -312,7 +312,7 @@ public static function option_referer_blacklist() {
312312 *
313313 * @return void
314314 */
315- public static function option_target_active () {
315+ public static function option_target_active (): void {
316316 ?>
317317 <fieldset>
318318 <legend class="screen-reader-text"><?php esc_html_e ( 'Activate live filter ' , 'statify-blacklist ' ); ?> </legend>
@@ -332,7 +332,7 @@ public static function option_target_active() {
332332 *
333333 * @return void
334334 */
335- public static function option_target_cron () {
335+ public static function option_target_cron (): void {
336336 ?>
337337 <fieldset>
338338 <legend class="screen-reader-text"><?php esc_html_e ( 'CronJob execution ' , 'statify-blacklist ' ); ?> </legend>
@@ -352,7 +352,7 @@ public static function option_target_cron() {
352352 *
353353 * @return void
354354 */
355- public static function option_target_regexp () {
355+ public static function option_target_regexp (): void {
356356 ?>
357357 <select id="statifyblacklist-target-regexp" name="statify-blacklist[target][regexp]">
358358 <option value="<?php print esc_attr ( StatifyBlacklist::MODE_NORMAL ); ?> " <?php selected ( StatifyBlacklist::$ options ['target ' ]['regexp ' ], StatifyBlacklist::MODE_NORMAL ); ?> >
@@ -378,7 +378,7 @@ public static function option_target_regexp() {
378378 *
379379 * @return void
380380 */
381- public static function option_target_blacklist () {
381+ public static function option_target_blacklist (): void {
382382 ?>
383383 <textarea id="statifyblacklist-target-blacklist" name="statify-blacklist[target][blacklist]" cols="40" rows="5"><?php
384384 print esc_html ( implode ( "\r\n" , array_keys ( StatifyBlacklist::$ options ['target ' ]['blacklist ' ] ) ) );
@@ -394,7 +394,7 @@ public static function option_target_blacklist() {
394394 *
395395 * @return void
396396 */
397- public static function option_ip_active () {
397+ public static function option_ip_active (): void {
398398 ?>
399399 <fieldset>
400400 <legend class="screen-reader-text"><?php esc_html_e ( 'Activate live filter ' , 'statify-blacklist ' ); ?> </legend>
@@ -416,7 +416,7 @@ public static function option_ip_active() {
416416 *
417417 * @return void
418418 */
419- public static function option_ip_blacklist () {
419+ public static function option_ip_blacklist (): void {
420420 ?>
421421 <textarea id="statifyblacklist-ip-blacklist" name="statify-blacklist[ip][blacklist]" cols="40" rows="5"><?php
422422 print esc_html ( implode ( "\r\n" , StatifyBlacklist::$ options ['ip ' ]['blacklist ' ] ) );
@@ -433,7 +433,7 @@ public static function option_ip_blacklist() {
433433 *
434434 * @return void
435435 */
436- public static function option_ua_active () {
436+ public static function option_ua_active (): void {
437437 ?>
438438 <label for="statifyblacklist-ua-active">
439439 <input id="statifyblacklist-ua-active" name="statify-blacklist[ua][active]" type="checkbox" value="1" <?php checked ( StatifyBlacklist::$ options ['ua ' ]['active ' ], 1 ); ?> >
@@ -453,7 +453,7 @@ public static function option_ua_active() {
453453 *
454454 * @return void
455455 */
456- public static function option_ua_regexp () {
456+ public static function option_ua_regexp (): void {
457457 ?>
458458 <select id="statifyblacklist-ua-regexp" name="statify-blacklist[ua][regexp]">
459459 <option value="<?php print esc_attr ( StatifyBlacklist::MODE_NORMAL ); ?> " <?php selected ( StatifyBlacklist::$ options ['ua ' ]['regexp ' ], StatifyBlacklist::MODE_NORMAL ); ?> >
@@ -484,7 +484,7 @@ public static function option_ua_regexp() {
484484 *
485485 * @return void
486486 */
487- public static function option_ua_blacklist () {
487+ public static function option_ua_blacklist (): void {
488488 ?>
489489 <textarea name="statify-blacklist[ua][blacklist]" id="statifyblacklist-ua-blacklist" cols="40" rows="5"><?php
490490 print esc_html ( implode ( "\r\n" , StatifyBlacklist::$ options ['ua ' ]['blacklist ' ] ) );
@@ -503,7 +503,7 @@ public static function option_ua_blacklist() {
503503 *
504504 * @return array Validated and sanitized options.
505505 */
506- public static function sanitize_options ( $ options ) {
506+ public static function sanitize_options ( array $ options ): array {
507507 // Extract filter lists from multi-line inputs.
508508 $ referer = self ::parse_multiline_option ( $ options ['referer ' ]['blacklist ' ] );
509509 $ target = self ::parse_multiline_option ( $ options ['target ' ]['blacklist ' ] );
@@ -553,7 +553,7 @@ public static function sanitize_options( $options ) {
553553 *
554554 * @since 1.7.0
555555 */
556- private static function sanitize_referer_options ( &$ options ) {
556+ private static function sanitize_referer_options ( array &$ options ): void {
557557 $ referer_given = $ options ['blacklist ' ];
558558 $ referer_invalid = array ();
559559 if ( StatifyBlacklist::MODE_NORMAL === $ options ['regexp ' ] ) {
@@ -596,7 +596,7 @@ private static function sanitize_referer_options( &$options ) {
596596 *
597597 * @since 1.7.0
598598 */
599- private static function sanitize_target_options ( &$ options ) {
599+ private static function sanitize_target_options ( array &$ options ): void {
600600 $ target_given = $ options ['blacklist ' ];
601601 $ target_sanitized = $ target_given ;
602602 if ( StatifyBlacklist::MODE_REGEX === $ options ['regexp ' ] || StatifyBlacklist::MODE_REGEX_CI === $ options ['regexp ' ] ) {
@@ -626,7 +626,7 @@ private static function sanitize_target_options( &$options ) {
626626 *
627627 * @since 1.7.0
628628 */
629- private static function sanitize_ip_options ( &$ options ) {
629+ private static function sanitize_ip_options ( array &$ options ): void {
630630 $ given_ip = $ options ['blacklist ' ];
631631 $ sanitized_ip = self ::sanitize_ips ( $ given_ip );
632632 $ ip_diff = array_diff ( $ given_ip , $ sanitized_ip );
@@ -654,7 +654,7 @@ private static function sanitize_ip_options( &$options ) {
654654 * @since 1.1.1
655655 * @since 1.7.0 moved from StatifyBlacklist_Admin to StatifyBlacklist_Settings.
656656 */
657- private static function sanitize_urls ( $ urls ) {
657+ private static function sanitize_urls ( array $ urls ): array {
658658 return array_flip (
659659 array_filter (
660660 array_map (
@@ -677,7 +677,7 @@ function ( $r ) {
677677 * @since 1.4.0
678678 * @since 1.7.0 moved from StatifyBlacklist_Admin to StatifyBlacklist_Settings.
679679 */
680- private static function sanitize_ips ( $ ips ) {
680+ private static function sanitize_ips ( array $ ips ): array {
681681 return array_values (
682682 array_unique (
683683 array_filter (
@@ -713,7 +713,7 @@ function ( $ip ) {
713713 * @since 1.5.0 #13
714714 * @since 1.7.0 moved from StatifyBlacklist_Admin to StatifyBlacklist_Settings.
715715 */
716- private static function sanitize_regex ( $ expressions ) {
716+ private static function sanitize_regex ( array $ expressions ): array {
717717 return array_filter (
718718 array_flip ( $ expressions ),
719719 function ( $ re ) {
@@ -732,7 +732,7 @@ function ( $re ) {
732732 *
733733 * @return array Parsed options.
734734 */
735- private static function parse_multiline_option ( $ raw ) {
735+ private static function parse_multiline_option ( string $ raw ): array {
736736 if ( empty ( trim ( $ raw ) ) ) {
737737 return array ();
738738 } else {
0 commit comments