@@ -17,8 +17,8 @@ |
||
17 | 17 | */ |
18 | 18 | |
19 | 19 | if ( ! class_exists( 'WP_Async_Request' ) ) { |
20 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
20 | + require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
21 | 21 | } |
22 | 22 | if ( ! class_exists( 'WP_Background_Process' ) ) { |
23 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
23 | + require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
24 | 24 | } |
@@ -16,9 +16,9 @@ |
||
16 | 16 | GitHub Branch: master |
17 | 17 | */ |
18 | 18 | |
19 | -if ( ! class_exists( 'WP_Async_Request' ) ) { |
|
20 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
19 | +if ( ! class_exists('WP_Async_Request')) { |
|
20 | + require_once plugin_dir_path(__FILE__).'classes/wp-async-request.php'; |
|
21 | 21 | } |
22 | -if ( ! class_exists( 'WP_Background_Process' ) ) { |
|
23 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
22 | +if ( ! class_exists('WP_Background_Process')) { |
|
23 | + require_once plugin_dir_path(__FILE__).'classes/wp-background-process.php'; |
|
24 | 24 | } |
@@ -21,12 +21,12 @@ |
||
21 | 21 | */ |
22 | 22 | private $body; |
23 | 23 | |
24 | - public function __construct( $response ) { |
|
24 | + public function __construct($response) { |
|
25 | 25 | |
26 | 26 | $this->response = $response; |
27 | - $this->code = wp_remote_retrieve_response_code( $this->response ); |
|
28 | - $this->is_success = ! empty( $this->code ) && 2 === intval( $this->code / 100 ); |
|
29 | - $this->body = wp_remote_retrieve_body( $this->response ); |
|
27 | + $this->code = wp_remote_retrieve_response_code($this->response); |
|
28 | + $this->is_success = ! empty($this->code) && 2 === intval($this->code / 100); |
|
29 | + $this->body = wp_remote_retrieve_body($this->response); |
|
30 | 30 | |
31 | 31 | } |
32 | 32 |
@@ -4,46 +4,46 @@ |
||
4 | 4 | |
5 | 5 | class Response { |
6 | 6 | |
7 | - private $response; |
|
7 | + private $response; |
|
8 | 8 | |
9 | - /** |
|
10 | - * @var int|string |
|
11 | - */ |
|
12 | - private $code; |
|
9 | + /** |
|
10 | + * @var int|string |
|
11 | + */ |
|
12 | + private $code; |
|
13 | 13 | |
14 | - /** |
|
15 | - * @var bool |
|
16 | - */ |
|
17 | - private $is_success; |
|
14 | + /** |
|
15 | + * @var bool |
|
16 | + */ |
|
17 | + private $is_success; |
|
18 | 18 | |
19 | - /** |
|
20 | - * @var string |
|
21 | - */ |
|
22 | - private $body; |
|
19 | + /** |
|
20 | + * @var string |
|
21 | + */ |
|
22 | + private $body; |
|
23 | 23 | |
24 | - public function __construct( $response ) { |
|
24 | + public function __construct( $response ) { |
|
25 | 25 | |
26 | - $this->response = $response; |
|
27 | - $this->code = wp_remote_retrieve_response_code( $this->response ); |
|
28 | - $this->is_success = ! empty( $this->code ) && 2 === intval( $this->code / 100 ); |
|
29 | - $this->body = wp_remote_retrieve_body( $this->response ); |
|
26 | + $this->response = $response; |
|
27 | + $this->code = wp_remote_retrieve_response_code( $this->response ); |
|
28 | + $this->is_success = ! empty( $this->code ) && 2 === intval( $this->code / 100 ); |
|
29 | + $this->body = wp_remote_retrieve_body( $this->response ); |
|
30 | 30 | |
31 | - } |
|
31 | + } |
|
32 | 32 | |
33 | - public function is_success() { |
|
33 | + public function is_success() { |
|
34 | 34 | |
35 | - return $this->is_success; |
|
35 | + return $this->is_success; |
|
36 | 36 | |
37 | - } |
|
37 | + } |
|
38 | 38 | |
39 | - public function get_body() { |
|
39 | + public function get_body() { |
|
40 | 40 | |
41 | - return $this->body; |
|
42 | - } |
|
41 | + return $this->body; |
|
42 | + } |
|
43 | 43 | |
44 | - public function get_response() { |
|
44 | + public function get_response() { |
|
45 | 45 | |
46 | - return $this->response; |
|
47 | - } |
|
46 | + return $this->response; |
|
47 | + } |
|
48 | 48 | |
49 | 49 | } |
@@ -2,6 +2,6 @@ |
||
2 | 2 | |
3 | 3 | // autoload.php @generated by Composer |
4 | 4 | |
5 | -require_once __DIR__ . '/composer/autoload_real.php'; |
|
5 | +require_once __DIR__.'/composer/autoload_real.php'; |
|
6 | 6 | |
7 | 7 | return ComposerAutoloaderInit30c84c47a44576eaa4b38cc478d5e11b::getLoader(); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @return Response |
17 | 17 | */ |
18 | - public function request( $method, $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
18 | + public function request($method, $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array()); |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @param $path |
@@ -27,6 +27,6 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return Response |
29 | 29 | */ |
30 | - public function get( $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
30 | + public function get($path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array()); |
|
31 | 31 | |
32 | 32 | } |
@@ -4,29 +4,29 @@ |
||
4 | 4 | |
5 | 5 | interface Api_Service { |
6 | 6 | |
7 | - /** |
|
8 | - * @param $method |
|
9 | - * @param $path |
|
10 | - * @param array $headers |
|
11 | - * @param null $body |
|
12 | - * @param null $timeout |
|
13 | - * @param null $user_agent |
|
14 | - * @param array $args |
|
15 | - * |
|
16 | - * @return Response |
|
17 | - */ |
|
18 | - public function request( $method, $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
7 | + /** |
|
8 | + * @param $method |
|
9 | + * @param $path |
|
10 | + * @param array $headers |
|
11 | + * @param null $body |
|
12 | + * @param null $timeout |
|
13 | + * @param null $user_agent |
|
14 | + * @param array $args |
|
15 | + * |
|
16 | + * @return Response |
|
17 | + */ |
|
18 | + public function request( $method, $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
19 | 19 | |
20 | - /** |
|
21 | - * @param $path |
|
22 | - * @param array $headers |
|
23 | - * @param null $body |
|
24 | - * @param null $timeout |
|
25 | - * @param null $user_agent |
|
26 | - * @param array $args |
|
27 | - * |
|
28 | - * @return Response |
|
29 | - */ |
|
30 | - public function get( $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
20 | + /** |
|
21 | + * @param $path |
|
22 | + * @param array $headers |
|
23 | + * @param null $body |
|
24 | + * @param null $timeout |
|
25 | + * @param null $user_agent |
|
26 | + * @param array $args |
|
27 | + * |
|
28 | + * @return Response |
|
29 | + */ |
|
30 | + public function get( $path, $headers = array(), $body = null, $timeout = null, $user_agent = null, $args = array() ); |
|
31 | 31 | |
32 | 32 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @param $last_update |
20 | 20 | * @param $state |
21 | 21 | */ |
22 | - public function __construct( $state, $started = null, $index = null, $count = null, $last_update = null ) { |
|
22 | + public function __construct($state, $started = null, $index = null, $count = null, $last_update = null) { |
|
23 | 23 | $this->started = $started; |
24 | 24 | $this->index = $index; |
25 | 25 | $this->count = (int) $count; |
@@ -4,27 +4,27 @@ |
||
4 | 4 | |
5 | 5 | class Sync_Background_Process_Info { |
6 | 6 | |
7 | - public $started; |
|
8 | - public $index; |
|
9 | - public $count; |
|
10 | - public $last_update; |
|
11 | - public $state; |
|
7 | + public $started; |
|
8 | + public $index; |
|
9 | + public $count; |
|
10 | + public $last_update; |
|
11 | + public $state; |
|
12 | 12 | |
13 | - /** |
|
14 | - * Sync_Model constructor. |
|
15 | - * |
|
16 | - * @param $started |
|
17 | - * @param $index |
|
18 | - * @param $count |
|
19 | - * @param $last_update |
|
20 | - * @param $state |
|
21 | - */ |
|
22 | - public function __construct( $state, $started = null, $index = null, $count = null, $last_update = null ) { |
|
23 | - $this->started = $started; |
|
24 | - $this->index = $index; |
|
25 | - $this->count = (int) $count; |
|
26 | - $this->last_update = $last_update; |
|
27 | - $this->state = $state; |
|
28 | - } |
|
13 | + /** |
|
14 | + * Sync_Model constructor. |
|
15 | + * |
|
16 | + * @param $started |
|
17 | + * @param $index |
|
18 | + * @param $count |
|
19 | + * @param $last_update |
|
20 | + * @param $state |
|
21 | + */ |
|
22 | + public function __construct( $state, $started = null, $index = null, $count = null, $last_update = null ) { |
|
23 | + $this->started = $started; |
|
24 | + $this->index = $index; |
|
25 | + $this->count = (int) $count; |
|
26 | + $this->last_update = $last_update; |
|
27 | + $this->state = $state; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | } |
@@ -21,9 +21,9 @@ |
||
21 | 21 | * |
22 | 22 | * @return bool |
23 | 23 | */ |
24 | - public static function is_local_entity_uri_exist( $entity_uri_service, $ids ) { |
|
25 | - foreach ( $ids as $id ) { |
|
26 | - if ( $entity_uri_service->is_internal( $id ) ) { |
|
24 | + public static function is_local_entity_uri_exist($entity_uri_service, $ids) { |
|
25 | + foreach ($ids as $id) { |
|
26 | + if ($entity_uri_service->is_internal($id)) { |
|
27 | 27 | return true; |
28 | 28 | } |
29 | 29 | } |
@@ -15,20 +15,20 @@ |
||
15 | 15 | |
16 | 16 | class Post_Entities_Validator { |
17 | 17 | |
18 | - /** |
|
19 | - * @param $entity_uri_service \Wordlift_Entity_Uri_Service |
|
20 | - * @param $ids array<string> An array of entity ids |
|
21 | - * |
|
22 | - * @return bool |
|
23 | - */ |
|
24 | - public static function is_local_entity_uri_exist( $entity_uri_service, $ids ) { |
|
25 | - foreach ( $ids as $id ) { |
|
26 | - if ( $entity_uri_service->is_internal( $id ) ) { |
|
27 | - return true; |
|
28 | - } |
|
29 | - } |
|
18 | + /** |
|
19 | + * @param $entity_uri_service \Wordlift_Entity_Uri_Service |
|
20 | + * @param $ids array<string> An array of entity ids |
|
21 | + * |
|
22 | + * @return bool |
|
23 | + */ |
|
24 | + public static function is_local_entity_uri_exist( $entity_uri_service, $ids ) { |
|
25 | + foreach ( $ids as $id ) { |
|
26 | + if ( $entity_uri_service->is_internal( $id ) ) { |
|
27 | + return true; |
|
28 | + } |
|
29 | + } |
|
30 | 30 | |
31 | - return false; |
|
32 | - } |
|
31 | + return false; |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |
@@ -21,16 +21,16 @@ |
||
21 | 21 | * |
22 | 22 | * @param $term_count Term_Count |
23 | 23 | */ |
24 | - public function __construct( $term_count ) { |
|
24 | + public function __construct($term_count) { |
|
25 | 25 | $this->term_count = $term_count; |
26 | 26 | } |
27 | 27 | |
28 | 28 | public function get_term_count() { |
29 | - $data = get_transient( self::TRANSIENT_KEY ); |
|
29 | + $data = get_transient(self::TRANSIENT_KEY); |
|
30 | 30 | |
31 | - if ( ! $data ) { |
|
31 | + if ( ! $data) { |
|
32 | 32 | $data = $this->term_count->get_term_count(); |
33 | - set_transient( self::TRANSIENT_KEY, $data, 8 * 60 * 60 ); |
|
33 | + set_transient(self::TRANSIENT_KEY, $data, 8 * 60 * 60); |
|
34 | 34 | |
35 | 35 | return $data; |
36 | 36 | } |
@@ -11,31 +11,31 @@ |
||
11 | 11 | */ |
12 | 12 | class Cached_Term_Count implements Term_Count { |
13 | 13 | |
14 | - const TRANSIENT_KEY = '_wl_vocabulary_term_count_transient'; |
|
15 | - /** |
|
16 | - * @var Term_Count |
|
17 | - */ |
|
18 | - private $term_count; |
|
19 | - |
|
20 | - /** |
|
21 | - * Cached_Term_Count constructor. |
|
22 | - * |
|
23 | - * @param $term_count Term_Count |
|
24 | - */ |
|
25 | - public function __construct( $term_count ) { |
|
26 | - $this->term_count = $term_count; |
|
27 | - } |
|
28 | - |
|
29 | - public function get_term_count() { |
|
30 | - $data = get_transient( self::TRANSIENT_KEY ); |
|
31 | - |
|
32 | - if ( ! $data ) { |
|
33 | - $data = $this->term_count->get_term_count(); |
|
34 | - set_transient( self::TRANSIENT_KEY, $data, 8 * 60 * 60 ); |
|
35 | - |
|
36 | - return $data; |
|
37 | - } |
|
38 | - |
|
39 | - return $data; |
|
40 | - } |
|
14 | + const TRANSIENT_KEY = '_wl_vocabulary_term_count_transient'; |
|
15 | + /** |
|
16 | + * @var Term_Count |
|
17 | + */ |
|
18 | + private $term_count; |
|
19 | + |
|
20 | + /** |
|
21 | + * Cached_Term_Count constructor. |
|
22 | + * |
|
23 | + * @param $term_count Term_Count |
|
24 | + */ |
|
25 | + public function __construct( $term_count ) { |
|
26 | + $this->term_count = $term_count; |
|
27 | + } |
|
28 | + |
|
29 | + public function get_term_count() { |
|
30 | + $data = get_transient( self::TRANSIENT_KEY ); |
|
31 | + |
|
32 | + if ( ! $data ) { |
|
33 | + $data = $this->term_count->get_term_count(); |
|
34 | + set_transient( self::TRANSIENT_KEY, $data, 8 * 60 * 60 ); |
|
35 | + |
|
36 | + return $data; |
|
37 | + } |
|
38 | + |
|
39 | + return $data; |
|
40 | + } |
|
41 | 41 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | interface Cache { |
6 | 6 | |
7 | - public function get( $cache_key ); |
|
7 | + public function get($cache_key); |
|
8 | 8 | |
9 | - public function put( $cache_key, $value ); |
|
9 | + public function put($cache_key, $value); |
|
10 | 10 | |
11 | 11 | public function flush_all(); |
12 | 12 |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | interface Cache { |
6 | 6 | |
7 | - public function get( $cache_key ); |
|
7 | + public function get( $cache_key ); |
|
8 | 8 | |
9 | - public function put( $cache_key, $value ); |
|
9 | + public function put( $cache_key, $value ); |
|
10 | 10 | |
11 | - public function flush_all(); |
|
11 | + public function flush_all(); |
|
12 | 12 | |
13 | 13 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * @param $default_value bool Default value for the flag, true or false. |
27 | 27 | * @param $callback Callable Callback for the feature. |
28 | 28 | */ |
29 | - public function __construct( $feature_slug, $default_value, $callback ) { |
|
29 | + public function __construct($feature_slug, $default_value, $callback) { |
|
30 | 30 | $this->feature_slug = $feature_slug; |
31 | 31 | $this->default_value = $default_value; |
32 | 32 | $this->callback = $callback; |
@@ -4,32 +4,32 @@ |
||
4 | 4 | |
5 | 5 | class Feature { |
6 | 6 | |
7 | - /** |
|
8 | - * @var string |
|
9 | - */ |
|
10 | - public $feature_slug; |
|
7 | + /** |
|
8 | + * @var string |
|
9 | + */ |
|
10 | + public $feature_slug; |
|
11 | 11 | |
12 | - /** |
|
13 | - * @var bool |
|
14 | - */ |
|
15 | - public $default_value; |
|
12 | + /** |
|
13 | + * @var bool |
|
14 | + */ |
|
15 | + public $default_value; |
|
16 | 16 | |
17 | - /** |
|
18 | - * @var Callable |
|
19 | - */ |
|
20 | - public $callback; |
|
17 | + /** |
|
18 | + * @var Callable |
|
19 | + */ |
|
20 | + public $callback; |
|
21 | 21 | |
22 | - /** |
|
23 | - * Feature constructor. |
|
24 | - * |
|
25 | - * @param $feature_slug string Slug for feature without wl__feature__enable |
|
26 | - * @param $default_value bool Default value for the flag, true or false. |
|
27 | - * @param $callback Callable Callback for the feature. |
|
28 | - */ |
|
29 | - public function __construct( $feature_slug, $default_value, $callback ) { |
|
30 | - $this->feature_slug = $feature_slug; |
|
31 | - $this->default_value = $default_value; |
|
32 | - $this->callback = $callback; |
|
33 | - } |
|
22 | + /** |
|
23 | + * Feature constructor. |
|
24 | + * |
|
25 | + * @param $feature_slug string Slug for feature without wl__feature__enable |
|
26 | + * @param $default_value bool Default value for the flag, true or false. |
|
27 | + * @param $callback Callable Callback for the feature. |
|
28 | + */ |
|
29 | + public function __construct( $feature_slug, $default_value, $callback ) { |
|
30 | + $this->feature_slug = $feature_slug; |
|
31 | + $this->default_value = $default_value; |
|
32 | + $this->callback = $callback; |
|
33 | + } |
|
34 | 34 | |
35 | 35 | } |