@@ -4,39 +4,39 @@ |
||
4 | 4 | |
5 | 5 | class Preconditions { |
6 | 6 | |
7 | - /** |
|
8 | - * @var Notices |
|
9 | - */ |
|
10 | - private $notices; |
|
11 | - |
|
12 | - public function __construct( Notices $notices ) { |
|
13 | - $this->notices = $notices; |
|
14 | - } |
|
15 | - |
|
16 | - public function pass() { |
|
17 | - return $this->has_prerequisites() && $this->check_version(); |
|
18 | - } |
|
19 | - |
|
20 | - private function has_prerequisites() { |
|
21 | - return defined( 'WPRM_VERSION' ) |
|
22 | - && class_exists( 'WP_Recipe_Maker' ) |
|
23 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
24 | - && apply_filters( 'wl_feature__enable__food-kg', false ); |
|
25 | - } |
|
26 | - |
|
27 | - private function check_version() { |
|
28 | - $check = version_compare( WPRM_VERSION, '8.1.0', '>=' ) |
|
29 | - && version_compare( WPRM_VERSION, '10.0.0', '<' ); |
|
30 | - |
|
31 | - if ( ! $check ) { |
|
32 | - $this->notices->queue( |
|
33 | - 'warning', |
|
34 | - /* translators: 1: minimum supported WPRM version, 2: maximum supported WPRM version, 3: Detected WP Recipe Maker version. */ |
|
35 | - sprintf( __( 'WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift' ), '8.1', '9', WPRM_VERSION ) |
|
36 | - ); |
|
37 | - } |
|
38 | - |
|
39 | - return $check; |
|
40 | - } |
|
7 | + /** |
|
8 | + * @var Notices |
|
9 | + */ |
|
10 | + private $notices; |
|
11 | + |
|
12 | + public function __construct( Notices $notices ) { |
|
13 | + $this->notices = $notices; |
|
14 | + } |
|
15 | + |
|
16 | + public function pass() { |
|
17 | + return $this->has_prerequisites() && $this->check_version(); |
|
18 | + } |
|
19 | + |
|
20 | + private function has_prerequisites() { |
|
21 | + return defined( 'WPRM_VERSION' ) |
|
22 | + && class_exists( 'WP_Recipe_Maker' ) |
|
23 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
24 | + && apply_filters( 'wl_feature__enable__food-kg', false ); |
|
25 | + } |
|
26 | + |
|
27 | + private function check_version() { |
|
28 | + $check = version_compare( WPRM_VERSION, '8.1.0', '>=' ) |
|
29 | + && version_compare( WPRM_VERSION, '10.0.0', '<' ); |
|
30 | + |
|
31 | + if ( ! $check ) { |
|
32 | + $this->notices->queue( |
|
33 | + 'warning', |
|
34 | + /* translators: 1: minimum supported WPRM version, 2: maximum supported WPRM version, 3: Detected WP Recipe Maker version. */ |
|
35 | + sprintf( __( 'WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift' ), '8.1', '9', WPRM_VERSION ) |
|
36 | + ); |
|
37 | + } |
|
38 | + |
|
39 | + return $check; |
|
40 | + } |
|
41 | 41 | |
42 | 42 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | private $notices; |
11 | 11 | |
12 | - public function __construct( Notices $notices ) { |
|
12 | + public function __construct(Notices $notices) { |
|
13 | 13 | $this->notices = $notices; |
14 | 14 | } |
15 | 15 | |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | private function has_prerequisites() { |
21 | - return defined( 'WPRM_VERSION' ) |
|
22 | - && class_exists( 'WP_Recipe_Maker' ) |
|
21 | + return defined('WPRM_VERSION') |
|
22 | + && class_exists('WP_Recipe_Maker') |
|
23 | 23 | // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
24 | - && apply_filters( 'wl_feature__enable__food-kg', false ); |
|
24 | + && apply_filters('wl_feature__enable__food-kg', false); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | private function check_version() { |
28 | - $check = version_compare( WPRM_VERSION, '8.1.0', '>=' ) |
|
29 | - && version_compare( WPRM_VERSION, '10.0.0', '<' ); |
|
28 | + $check = version_compare(WPRM_VERSION, '8.1.0', '>=') |
|
29 | + && version_compare(WPRM_VERSION, '10.0.0', '<'); |
|
30 | 30 | |
31 | - if ( ! $check ) { |
|
31 | + if ( ! $check) { |
|
32 | 32 | $this->notices->queue( |
33 | 33 | 'warning', |
34 | 34 | /* translators: 1: minimum supported WPRM version, 2: maximum supported WPRM version, 3: Detected WP Recipe Maker version. */ |
35 | - sprintf( __( 'WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift' ), '8.1', '9', WPRM_VERSION ) |
|
35 | + sprintf(__('WordLift Food KG support requires WP Recipe Maker %1$s-%2$s, %3$s found.', 'wordlift'), '8.1', '9', WPRM_VERSION) |
|
36 | 36 | ); |
37 | 37 | } |
38 | 38 |