Skip to content

Commit

Permalink
see #607: minor changes to the comments to respect codeclimate checks
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyan0v committed Sep 5, 2017
1 parent 2c49ae0 commit 89bdd16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/includes/class-wordlift-autocomplete-adapter.php
Expand Up @@ -36,7 +36,7 @@ class Wordlift_Autocomplete_Adapter {
*
* @since 3.14.2
*
* @param \Wordlift_Autocomplete_Service $autocomplete_service
* @param \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
*/
public function __construct( $autocomplete_service ) {
$this->autocomplete_service = $autocomplete_service;
Expand All @@ -46,15 +46,13 @@ public function __construct( $autocomplete_service ) {
* Handle the autocomplete ajax request.
*
* @since 3.15.0
*
* @return string The entity base path.
*/
public function wl_autocomplete() {
if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'wordlift_autocomplete' ) ) {
wp_send_json_error( array( 'message' => 'Nonce field doens\'t match' ) );
}

// Return
// Return error if the query param si empty.
if ( empty( $_REQUEST['query'] ) ) {
wp_send_json_error( array( 'message' => 'The query param is empty!' ) );
}
Expand Down
6 changes: 3 additions & 3 deletions src/includes/class-wordlift-autocomplete-service.php
Expand Up @@ -45,7 +45,7 @@ class Wordlift_Autocomplete_Service {
*
* @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
*/
public function __construct ( $configuration_service ) {
public function __construct( $configuration_service ) {
$this->configuration_service = $configuration_service;
$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Autocomplete_Service' );
}
Expand All @@ -55,7 +55,7 @@ public function __construct ( $configuration_service ) {
*
* @since 3.15.0
*
* @param string $query The search string
* @param string $query The search string.
*
* @return array $response The API response.
*/
Expand All @@ -74,7 +74,7 @@ public function make_request( $query ) {
*
* @since 3.15.0
*
* @param string $query The search string
* @param string $query The search string.
*
* @return string Builded url.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/includes/class-wordlift.php
Expand Up @@ -1335,8 +1335,8 @@ private function define_admin_hooks() {
$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );

// Handle the autocomplete request.
add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete') );
add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete') );
add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) );
add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) );

// Hooks to restrict multisite super admin from manipulating entity types.
if ( is_multisite() ) {
Expand Down

0 comments on commit 89bdd16

Please sign in to comment.