@@ -29,6 +29,6 @@ |
||
| 29 | 29 | * @since 3.16.0 $references argument added. |
| 30 | 30 | * @since 3.10.0 |
| 31 | 31 | */ |
| 32 | - public function convert( $post_id, &$references = array(), &$references_infos = array() ); |
|
| 32 | + public function convert($post_id, &$references = array(), &$references_infos = array()); |
|
| 33 | 33 | |
| 34 | 34 | } |
@@ -17,17 +17,17 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | interface Wordlift_Post_Converter { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Convert the specified post id. |
|
| 22 | - * |
|
| 23 | - * @param int $post_id The post id. |
|
| 24 | - * @param array $references An array of posts referenced by the specified post. |
|
| 25 | - * @param array $references_infos |
|
| 26 | - * |
|
| 27 | - * @return mixed The conversion result. |
|
| 28 | - * @since 3.16.0 $references argument added. |
|
| 29 | - * @since 3.10.0 |
|
| 30 | - */ |
|
| 31 | - public function convert( $post_id, &$references = array(), &$references_infos = array() ); |
|
| 20 | + /** |
|
| 21 | + * Convert the specified post id. |
|
| 22 | + * |
|
| 23 | + * @param int $post_id The post id. |
|
| 24 | + * @param array $references An array of posts referenced by the specified post. |
|
| 25 | + * @param array $references_infos |
|
| 26 | + * |
|
| 27 | + * @return mixed The conversion result. |
|
| 28 | + * @since 3.16.0 $references argument added. |
|
| 29 | + * @since 3.10.0 |
|
| 30 | + */ |
|
| 31 | + public function convert( $post_id, &$references = array(), &$references_infos = array() ); |
|
| 32 | 32 | |
| 33 | 33 | } |
@@ -10,15 +10,15 @@ |
||
| 10 | 10 | |
| 11 | 11 | interface Reference { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * @return int |
|
| 15 | - */ |
|
| 16 | - public function get_type(); |
|
| 13 | + /** |
|
| 14 | + * @return int |
|
| 15 | + */ |
|
| 16 | + public function get_type(); |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @return int Identifier |
|
| 20 | - */ |
|
| 21 | - public function get_id(); |
|
| 18 | + /** |
|
| 19 | + * @return int Identifier |
|
| 20 | + */ |
|
| 21 | + public function get_id(); |
|
| 22 | 22 | |
| 23 | 23 | } |
| 24 | 24 | |
@@ -18,42 +18,42 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class Wordlift_Url_Property_Storage extends Wordlift_Storage { |
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * The {@link Wordlift_Property_Getter} instance. |
|
| 23 | - * |
|
| 24 | - * @since 3.15.0 |
|
| 25 | - * @access private |
|
| 26 | - * @var \Wordlift_Property_Getter The {@link Wordlift_Property_Getter} |
|
| 27 | - * instance. |
|
| 28 | - */ |
|
| 29 | - private $property_getter; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * Create a {@link Wordlift_Property_Storage} instance. |
|
| 33 | - * |
|
| 34 | - * @since 3.15.0 |
|
| 35 | - * |
|
| 36 | - * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} |
|
| 37 | - * instance. |
|
| 38 | - */ |
|
| 39 | - public function __construct( $property_getter ) { |
|
| 40 | - |
|
| 41 | - $this->property_getter = $property_getter; |
|
| 42 | - |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * Get the values for the property of the {@link WP_Post}. |
|
| 47 | - * |
|
| 48 | - * @since 3.15.0 |
|
| 49 | - * |
|
| 50 | - * @param int $post_id The {@link WP_Post}'s id. |
|
| 51 | - * |
|
| 52 | - * @return array |
|
| 53 | - */ |
|
| 54 | - public function get( $post_id ) { |
|
| 55 | - |
|
| 56 | - return $this->property_getter->get( $post_id, Wordlift_Schema_Url_Property_Service::META_KEY, Object_Type_Enum::POST ); |
|
| 57 | - } |
|
| 21 | + /** |
|
| 22 | + * The {@link Wordlift_Property_Getter} instance. |
|
| 23 | + * |
|
| 24 | + * @since 3.15.0 |
|
| 25 | + * @access private |
|
| 26 | + * @var \Wordlift_Property_Getter The {@link Wordlift_Property_Getter} |
|
| 27 | + * instance. |
|
| 28 | + */ |
|
| 29 | + private $property_getter; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * Create a {@link Wordlift_Property_Storage} instance. |
|
| 33 | + * |
|
| 34 | + * @since 3.15.0 |
|
| 35 | + * |
|
| 36 | + * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} |
|
| 37 | + * instance. |
|
| 38 | + */ |
|
| 39 | + public function __construct( $property_getter ) { |
|
| 40 | + |
|
| 41 | + $this->property_getter = $property_getter; |
|
| 42 | + |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * Get the values for the property of the {@link WP_Post}. |
|
| 47 | + * |
|
| 48 | + * @since 3.15.0 |
|
| 49 | + * |
|
| 50 | + * @param int $post_id The {@link WP_Post}'s id. |
|
| 51 | + * |
|
| 52 | + * @return array |
|
| 53 | + */ |
|
| 54 | + public function get( $post_id ) { |
|
| 55 | + |
|
| 56 | + return $this->property_getter->get( $post_id, Wordlift_Schema_Url_Property_Service::META_KEY, Object_Type_Enum::POST ); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param \Wordlift_Property_Getter $property_getter The {@link Wordlift_Property_Getter} |
| 37 | 37 | * instance. |
| 38 | 38 | */ |
| 39 | - public function __construct( $property_getter ) { |
|
| 39 | + public function __construct($property_getter) { |
|
| 40 | 40 | |
| 41 | 41 | $this->property_getter = $property_getter; |
| 42 | 42 | |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @return array |
| 53 | 53 | */ |
| 54 | - public function get( $post_id ) { |
|
| 54 | + public function get($post_id) { |
|
| 55 | 55 | |
| 56 | - return $this->property_getter->get( $post_id, Wordlift_Schema_Url_Property_Service::META_KEY, Object_Type_Enum::POST ); |
|
| 56 | + return $this->property_getter->get($post_id, Wordlift_Schema_Url_Property_Service::META_KEY, Object_Type_Enum::POST); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | } |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | * |
| 22 | 22 | * @return Relation_Service_Interface |
| 23 | 23 | */ |
| 24 | - public static function get_instance( $post_id ) { |
|
| 24 | + public static function get_instance($post_id) { |
|
| 25 | 25 | // The post type doesnt have an editor and no-editor-analysis feature is turned on. |
| 26 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 26 | + if (No_Editor_Analysis_Feature::can_no_editor_analysis_be_used($post_id)) { |
|
| 27 | 27 | return Object_No_Annotation_Relation_Service::get_instance(); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -15,19 +15,19 @@ |
||
| 15 | 15 | |
| 16 | 16 | class Object_Relation_Factory { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @param int $post_id |
|
| 20 | - * |
|
| 21 | - * @return Relation_Service_Interface |
|
| 22 | - */ |
|
| 23 | - public static function get_instance( $post_id ) { |
|
| 24 | - // The post type doesnt have an editor and no-editor-analysis feature is turned on. |
|
| 25 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 26 | - return Object_No_Annotation_Relation_Service::get_instance(); |
|
| 27 | - } |
|
| 18 | + /** |
|
| 19 | + * @param int $post_id |
|
| 20 | + * |
|
| 21 | + * @return Relation_Service_Interface |
|
| 22 | + */ |
|
| 23 | + public static function get_instance( $post_id ) { |
|
| 24 | + // The post type doesnt have an editor and no-editor-analysis feature is turned on. |
|
| 25 | + if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 26 | + return Object_No_Annotation_Relation_Service::get_instance(); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - return Object_Relation_Service::get_instance(); |
|
| 29 | + return Object_Relation_Service::get_instance(); |
|
| 30 | 30 | |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | } |
@@ -17,18 +17,18 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class Analysis_Service_Factory { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Get the analysis service conditionally. |
|
| 22 | - * |
|
| 23 | - * @return Analysis_Service |
|
| 24 | - */ |
|
| 25 | - public static function get_instance( $post_id ) { |
|
| 26 | - // We want this analysis to happen only when the editor is not present. |
|
| 27 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 28 | - return No_Editor_Analysis_Service::get_instance(); |
|
| 29 | - } |
|
| 20 | + /** |
|
| 21 | + * Get the analysis service conditionally. |
|
| 22 | + * |
|
| 23 | + * @return Analysis_Service |
|
| 24 | + */ |
|
| 25 | + public static function get_instance( $post_id ) { |
|
| 26 | + // We want this analysis to happen only when the editor is not present. |
|
| 27 | + if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 28 | + return No_Editor_Analysis_Service::get_instance(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - return V1_Analysis_Service::get_instance(); |
|
| 32 | - } |
|
| 31 | + return V1_Analysis_Service::get_instance(); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | 34 | } |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | * |
| 23 | 23 | * @return Analysis_Service |
| 24 | 24 | */ |
| 25 | - public static function get_instance( $post_id ) { |
|
| 25 | + public static function get_instance($post_id) { |
|
| 26 | 26 | // We want this analysis to happen only when the editor is not present. |
| 27 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 27 | + if (No_Editor_Analysis_Feature::can_no_editor_analysis_be_used($post_id)) { |
|
| 28 | 28 | return No_Editor_Analysis_Service::get_instance(); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -15,19 +15,19 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | abstract class Abstract_Analysis_Service extends Singleton implements Analysis_Service { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Wordlift api service. |
|
| 20 | - * |
|
| 21 | - * @var \Wordlift_Api_Service |
|
| 22 | - */ |
|
| 23 | - protected $api_service; |
|
| 18 | + /** |
|
| 19 | + * Wordlift api service. |
|
| 20 | + * |
|
| 21 | + * @var \Wordlift_Api_Service |
|
| 22 | + */ |
|
| 23 | + protected $api_service; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Abstract_Analysis_Service constructor. |
|
| 27 | - */ |
|
| 28 | - public function __construct() { |
|
| 29 | - parent::__construct(); |
|
| 30 | - $this->api_service = \Wordlift_Api_Service::get_instance(); |
|
| 31 | - } |
|
| 25 | + /** |
|
| 26 | + * Abstract_Analysis_Service constructor. |
|
| 27 | + */ |
|
| 28 | + public function __construct() { |
|
| 29 | + parent::__construct(); |
|
| 30 | + $this->api_service = \Wordlift_Api_Service::get_instance(); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | } |
@@ -15,8 +15,8 @@ |
||
| 15 | 15 | * |
| 16 | 16 | * @return Occurrences |
| 17 | 17 | */ |
| 18 | - public static function get_instance( $post_id ) { |
|
| 19 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 18 | + public static function get_instance($post_id) { |
|
| 19 | + if (No_Editor_Analysis_Feature::can_no_editor_analysis_be_used($post_id)) { |
|
| 20 | 20 | return No_Annotation_Strategy::get_instance(); |
| 21 | 21 | } |
| 22 | 22 | return Default_Strategy::get_instance(); |
@@ -11,16 +11,16 @@ |
||
| 11 | 11 | |
| 12 | 12 | class Occurrences_Factory { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * @param $post_id |
|
| 16 | - * |
|
| 17 | - * @return Occurrences |
|
| 18 | - */ |
|
| 19 | - public static function get_instance( $post_id ) { |
|
| 20 | - if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 21 | - return No_Annotation_Strategy::get_instance(); |
|
| 22 | - } |
|
| 23 | - return Default_Strategy::get_instance(); |
|
| 24 | - } |
|
| 14 | + /** |
|
| 15 | + * @param $post_id |
|
| 16 | + * |
|
| 17 | + * @return Occurrences |
|
| 18 | + */ |
|
| 19 | + public static function get_instance( $post_id ) { |
|
| 20 | + if ( No_Editor_Analysis_Feature::can_no_editor_analysis_be_used( $post_id ) ) { |
|
| 21 | + return No_Annotation_Strategy::get_instance(); |
|
| 22 | + } |
|
| 23 | + return Default_Strategy::get_instance(); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | 26 | } |
@@ -14,15 +14,15 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | interface Analysis_Service { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Return analysis response from the service. |
|
| 19 | - * |
|
| 20 | - * @param array $data The analysis data. |
|
| 21 | - * @param String $content_type Content type for the request. |
|
| 22 | - * @param int $post_id Post id. |
|
| 23 | - * |
|
| 24 | - * @return string|object|\WP_Error A {@link WP_Error} instance or the actual response content. |
|
| 25 | - */ |
|
| 26 | - public function get_analysis_response( $data, $content_type, $post_id ); |
|
| 17 | + /** |
|
| 18 | + * Return analysis response from the service. |
|
| 19 | + * |
|
| 20 | + * @param array $data The analysis data. |
|
| 21 | + * @param String $content_type Content type for the request. |
|
| 22 | + * @param int $post_id Post id. |
|
| 23 | + * |
|
| 24 | + * @return string|object|\WP_Error A {@link WP_Error} instance or the actual response content. |
|
| 25 | + */ |
|
| 26 | + public function get_analysis_response( $data, $content_type, $post_id ); |
|
| 27 | 27 | |
| 28 | 28 | } |
@@ -23,6 +23,6 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @return string|object|\WP_Error A {@link WP_Error} instance or the actual response content. |
| 25 | 25 | */ |
| 26 | - public function get_analysis_response( $data, $content_type, $post_id ); |
|
| 26 | + public function get_analysis_response($data, $content_type, $post_id); |
|
| 27 | 27 | |
| 28 | 28 | } |
@@ -8,9 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | interface Occurrences { |
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * @return array Return json data structure. |
|
| 13 | - */ |
|
| 14 | - public function add_occurences_to_entities( $occurrences, $json, $post_id ); |
|
| 11 | + /** |
|
| 12 | + * @return array Return json data structure. |
|
| 13 | + */ |
|
| 14 | + public function add_occurences_to_entities( $occurrences, $json, $post_id ); |
|
| 15 | 15 | |
| 16 | 16 | } |
@@ -11,6 +11,6 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * @return array Return json data structure. |
| 13 | 13 | */ |
| 14 | - public function add_occurences_to_entities( $occurrences, $json, $post_id ); |
|
| 14 | + public function add_occurences_to_entities($occurrences, $json, $post_id); |
|
| 15 | 15 | |
| 16 | 16 | } |