@@ -65,9 +65,9 @@ |
||
| 65 | 65 | __METHOD__ |
| 66 | 66 | , '2.2.0' |
| 67 | 67 | , esc_html( get_class( $this->entity ) ) |
| 68 | - . ' implements the WordPoints_Entity_Restricted_VisibilityI' |
|
| 69 | - . ' interface, which has been deprecated. Use the entity' |
|
| 70 | - . ' restrictions API instead.' |
|
| 68 | + . ' implements the WordPoints_Entity_Restricted_VisibilityI' |
|
| 69 | + . ' interface, which has been deprecated. Use the entity' |
|
| 70 | + . ' restrictions API instead.' |
|
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | $this->restricted_entity = $this->entity; |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $this->entity_id = $entity_id; |
| 53 | 53 | |
| 54 | - $entity = wordpoints_entities()->get( $hierarchy[0] ); |
|
| 54 | + $entity = wordpoints_entities()->get( $hierarchy[ 0 ] ); |
|
| 55 | 55 | |
| 56 | 56 | if ( ! $entity instanceof WordPoints_Entity ) { |
| 57 | 57 | return; |
@@ -75,8 +75,8 @@ |
||
| 75 | 75 | 'options' => array( |
| 76 | 76 | 'wordpoints_sitewide_active_modules', |
| 77 | 77 | 'wordpoints_network_install_skipped', |
| 78 | - 'wordpoints_network_installed', |
|
| 79 | - 'wordpoints_network_update_skipped', |
|
| 78 | + 'wordpoints_network_installed', |
|
| 79 | + 'wordpoints_network_update_skipped', |
|
| 80 | 80 | 'wordpoints_breaking_deactivated_modules', |
| 81 | 81 | ), |
| 82 | 82 | ), |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | parent::before_update(); |
| 141 | 141 | |
| 142 | 142 | if ( $this->network_wide ) { |
| 143 | - unset( $this->updates['1_8_0'] ); |
|
| 143 | + unset( $this->updates[ '1_8_0' ] ); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | // Make sure the version is set properly even if the data is already |
| 169 | 169 | // there, in case the plugin is being reactivated and things had been |
| 170 | 170 | // corrupted somehow. |
| 171 | - $data['version'] = WORDPOINTS_VERSION; |
|
| 171 | + $data[ 'version' ] = WORDPOINTS_VERSION; |
|
| 172 | 172 | |
| 173 | 173 | wordpoints_update_maybe_network_option( 'wordpoints_data', $data ); |
| 174 | 174 | } |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | ) { |
| 101 | 101 | |
| 102 | 102 | return 'wordpoints_create_hook_reaction|' . $reaction_store->get_slug() |
| 103 | - . '|' . wordpoints_hooks()->get_current_mode() |
|
| 104 | - . '|' . wp_json_encode( $reaction_store->get_context_id() ); |
|
| 103 | + . '|' . wordpoints_hooks()->get_current_mode() |
|
| 104 | + . '|' . wp_json_encode( $reaction_store->get_context_id() ); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | WordPoints_Hook_ReactionI $reaction |
| 132 | 132 | ) { |
| 133 | 133 | return 'wordpoints_update_hook_reaction|' |
| 134 | - . wp_json_encode( $reaction->get_guid() ); |
|
| 134 | + . wp_json_encode( $reaction->get_guid() ); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | WordPoints_Hook_ReactionI $reaction |
| 162 | 162 | ) { |
| 163 | 163 | return 'wordpoints_delete_hook_reaction|' |
| 164 | - . wp_json_encode( $reaction->get_guid() ); |
|
| 164 | + . wp_json_encode( $reaction->get_guid() ); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | private function verify_request( $action ) { |
| 317 | 317 | |
| 318 | 318 | if ( |
| 319 | - empty( $_POST['nonce'] ) |
|
| 319 | + empty( $_POST[ 'nonce' ] ) |
|
| 320 | 320 | || ! wordpoints_verify_nonce( 'nonce', $action, null, 'post' ) |
| 321 | 321 | ) { |
| 322 | 322 | wp_send_json_error( |
@@ -334,11 +334,11 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | protected function get_reaction_store() { |
| 336 | 336 | |
| 337 | - if ( ! isset( $_POST['reaction_store'] ) ) { // WPCS: CSRF OK. |
|
| 337 | + if ( ! isset( $_POST[ 'reaction_store' ] ) ) { // WPCS: CSRF OK. |
|
| 338 | 338 | $this->unexpected_error( 'reaction_store' ); |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | - $reactor_slug = sanitize_key( $_POST['reaction_store'] ); // WPCS: CSRF OK. |
|
| 341 | + $reactor_slug = sanitize_key( $_POST[ 'reaction_store' ] ); // WPCS: CSRF OK. |
|
| 342 | 342 | |
| 343 | 343 | $reaction_store = wordpoints_hooks()->get_reaction_store( $reactor_slug ); |
| 344 | 344 | |
@@ -361,12 +361,12 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | protected function get_reaction() { |
| 363 | 363 | |
| 364 | - if ( ! isset( $_POST['id'] ) ) { // WPCS: CSRF OK. |
|
| 364 | + if ( ! isset( $_POST[ 'id' ] ) ) { // WPCS: CSRF OK. |
|
| 365 | 365 | $this->unexpected_error( 'id' ); |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | $reaction = $this->reaction_store->get_reaction( |
| 369 | - wordpoints_int( $_POST['id'] ) // WPCS: CSRF OK. |
|
| 369 | + wordpoints_int( $_POST[ 'id' ] ) // WPCS: CSRF OK. |
|
| 370 | 370 | ); |
| 371 | 371 | |
| 372 | 372 | if ( ! $reaction ) { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | |
| 388 | 388 | $data = wp_unslash( $_POST ); // WPCS: CSRF OK. |
| 389 | 389 | |
| 390 | - unset( $data['id'], $data['action'], $data['nonce'], $data['reaction_store'] ); |
|
| 390 | + unset( $data[ 'id' ], $data[ 'action' ], $data[ 'nonce' ], $data[ 'reaction_store' ] ); |
|
| 391 | 391 | |
| 392 | 392 | return $data; |
| 393 | 393 | } |
@@ -334,7 +334,8 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | protected function get_reaction_store() { |
| 336 | 336 | |
| 337 | - if ( ! isset( $_POST['reaction_store'] ) ) { // WPCS: CSRF OK. |
|
| 337 | + if ( ! isset( $_POST['reaction_store'] ) ) { |
|
| 338 | +// WPCS: CSRF OK. |
|
| 338 | 339 | $this->unexpected_error( 'reaction_store' ); |
| 339 | 340 | } |
| 340 | 341 | |
@@ -361,7 +362,8 @@ discard block |
||
| 361 | 362 | */ |
| 362 | 363 | protected function get_reaction() { |
| 363 | 364 | |
| 364 | - if ( ! isset( $_POST['id'] ) ) { // WPCS: CSRF OK. |
|
| 365 | + if ( ! isset( $_POST['id'] ) ) { |
|
| 366 | +// WPCS: CSRF OK. |
|
| 365 | 367 | $this->unexpected_error( 'id' ); |
| 366 | 368 | } |
| 367 | 369 | |
@@ -92,6 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @param string $parent_slug The group slug. |
| 94 | 94 | * @param string $slug The slug of the class to deregister. |
| 95 | + * @return void |
|
| 95 | 96 | */ |
| 96 | 97 | public function deregister( $parent_slug, $slug ); |
| 97 | 98 | |
@@ -101,6 +102,7 @@ discard block |
||
| 101 | 102 | * @since 2.1.0 |
| 102 | 103 | * |
| 103 | 104 | * @param string $parent_slug The group slug. |
| 105 | + * @return void |
|
| 104 | 106 | */ |
| 105 | 107 | public function deregister_children( $parent_slug ); |
| 106 | 108 | |
@@ -76,6 +76,7 @@ discard block |
||
| 76 | 76 | * @param string $slug The slug of the class to deregister. |
| 77 | 77 | * @param string[] $parent_slugs The slug(s) of the class's parent(s) in the |
| 78 | 78 | * hierarchy. |
| 79 | + * @return void |
|
| 79 | 80 | */ |
| 80 | 81 | public function deregister( $slug, array $parent_slugs = array() ); |
| 81 | 82 | |
@@ -85,6 +86,7 @@ discard block |
||
| 85 | 86 | * @since 2.2.0 |
| 86 | 87 | * |
| 87 | 88 | * @param string[] $parent_slugs The hierarchy of the parent. |
| 89 | + * @return void |
|
| 88 | 90 | */ |
| 89 | 91 | public function deregister_children( array $parent_slugs = array() ); |
| 90 | 92 | |
@@ -71,6 +71,7 @@ |
||
| 71 | 71 | * @since 2.1.0 |
| 72 | 72 | * |
| 73 | 73 | * @param string $slug The slug of the class to deregister. |
| 74 | + * @return void |
|
| 74 | 75 | */ |
| 75 | 76 | public function deregister( $slug ); |
| 76 | 77 | |
@@ -430,7 +430,7 @@ |
||
| 430 | 430 | * |
| 431 | 431 | * @since 2.1.0 |
| 432 | 432 | * |
| 433 | - * @return mixed The ID of the entity. |
|
| 433 | + * @return integer The ID of the entity. |
|
| 434 | 434 | */ |
| 435 | 435 | public function get_the_id() { |
| 436 | 436 | return $this->get_the_value(); |
@@ -385,10 +385,10 @@ |
||
| 385 | 385 | } elseif ( $this->is_guid( $value ) ) { |
| 386 | 386 | |
| 387 | 387 | $guid = $this->split_guid( $value ); |
| 388 | - $context = $guid['context']; |
|
| 389 | - $value = $guid['id']; |
|
| 388 | + $context = $guid[ 'context' ]; |
|
| 389 | + $value = $guid[ 'id' ]; |
|
| 390 | 390 | |
| 391 | - $entity = $this->get_entity_from_context( $guid['id'], $context ); |
|
| 391 | + $entity = $this->get_entity_from_context( $guid[ 'id' ], $context ); |
|
| 392 | 392 | |
| 393 | 393 | } else { |
| 394 | 394 | |
@@ -32,6 +32,7 @@ discard block |
||
| 32 | 32 | * @since 2.1.0 |
| 33 | 33 | * |
| 34 | 34 | * @param WordPoints_Entity $entity An entity. |
| 35 | + * @return void |
|
| 35 | 36 | */ |
| 36 | 37 | public function add_entity( WordPoints_Entity $entity ); |
| 37 | 38 | |
@@ -41,6 +42,7 @@ discard block |
||
| 41 | 42 | * @since 2.1.0 |
| 42 | 43 | * |
| 43 | 44 | * @param string $slug The slug of the entity to remove. |
| 45 | + * @return void |
|
| 44 | 46 | */ |
| 45 | 47 | public function remove_entity( $slug ); |
| 46 | 48 | |
@@ -21,6 +21,7 @@ |
||
| 21 | 21 | * @param string[] $hierarchy The hierarchy of this entity, consisting of the |
| 22 | 22 | * entity slug followed by the slugs leading to the |
| 23 | 23 | * descendant in question, if not the entity itself. |
| 24 | + * @return void |
|
| 24 | 25 | */ |
| 25 | 26 | public function __construct( $entity_id, array $hierarchy ); |
| 26 | 27 | |