Skip to content

Commit a0cd157

Browse files
danielbachhuberataylorme
authored andcommitted
Fix PHPCS issues flagged in WPCS v1.1.0 (#384)
1 parent 5077ad0 commit a0cd157

File tree

5 files changed

+45
-14
lines changed

5 files changed

+45
-14
lines changed

includes/class-solrpower-api.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ function master_query( $solr, $qry, $offset, $count, $fq, $sortby, $order, &$plu
347347
$taxonomies = (array) get_taxonomies(
348348
array(
349349
'_builtin' => false,
350-
), 'names'
350+
),
351+
'names'
351352
);
352353
foreach ( $taxonomies as $parent ) {
353354
$facet_fields[] = $parent . '_taxonomy_str';

includes/class-solrpower-facet-widget.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ function fetch_facets( $echo = true ) {
149149
array(
150150
__CLASS__,
151151
'htmlspecialchars_decode',
152-
), $this->facets[ $facet_name ]
152+
),
153+
$this->facets[ $facet_name ]
153154
);
154155
}
155156
}

includes/class-solrpower-options.php

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ function __construct() {
5454
*/
5555
function add_pages() {
5656
add_menu_page(
57-
'Solr Power', 'Solr Power', 'manage_options', 'solr-power', array(
57+
'Solr Power',
58+
'Solr Power',
59+
'manage_options',
60+
'solr-power',
61+
array(
5862
$this,
5963
'options_page',
60-
), 'dashicons-search'
64+
),
65+
'dashicons-search'
6166
);
6267
}
6368

@@ -517,14 +522,26 @@ private function results_section() {
517522
);
518523

519524
$this->add_field(
520-
's4wp_default_operator', 'Default Search Operator', $page, $section, 'radio', null, array(
525+
's4wp_default_operator',
526+
'Default Search Operator',
527+
$page,
528+
$section,
529+
'radio',
530+
null,
531+
array(
521532
'OR',
522533
'AND',
523534
)
524535
);
525536

526537
$this->add_field(
527-
's4wp_default_sort', 'Default Sort', $page, $section, 'select', null, array(
538+
's4wp_default_sort',
539+
'Default Sort',
540+
$page,
541+
$section,
542+
'select',
543+
null,
544+
array(
528545
'score',
529546
'displaydate',
530547
)
@@ -577,10 +594,15 @@ private function add_field( $name, $title, $page = 'solr-power', $section, $type
577594
'choices' => $choices,
578595
);
579596
add_settings_field(
580-
$name, $title, array(
597+
$name,
598+
$title,
599+
array(
581600
$this,
582601
'render_field',
583-
), $page, $section, $args
602+
),
603+
$page,
604+
$section,
605+
$args
584606
);
585607
}
586608

includes/class-solrpower-sync.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ function build_document(
327327
$taxonomies = (array) get_taxonomies(
328328
array(
329329
'_builtin' => false,
330-
), 'names'
330+
),
331+
'names'
331332
);
332333
foreach ( $taxonomies as $parent ) {
333334
$terms = get_the_terms( $post_info->ID, $parent );

includes/class-solrpower.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public function __construct() {
4444
add_filter( 'plugin_action_links', array( $this, 'plugin_settings_link' ), 10, 2 );
4545
add_filter( 'debug_bar_panels', array( $this, 'add_panel' ) );
4646
add_action(
47-
'widgets_init', function () {
47+
'widgets_init',
48+
function () {
4849
register_widget( 'SolrPower_Facet_Widget' );
4950
}
5051
);
@@ -87,7 +88,8 @@ public function sanity_check() {
8788

8889
if ( getenv( 'PANTHEON_ENVIRONMENT' ) !== false && getenv( 'PANTHEON_INDEX_HOST' ) === false ) {
8990
$return_value = wp_kses(
90-
__( 'Before you can activate this plugin, you must first <a href="https://pantheon.io/docs/articles/sites/apache-solr/">activate Solr</a> in your Pantheon Dashboard.', 'solr-for-wordpress-on-pantheon' ), array(
91+
__( 'Before you can activate this plugin, you must first <a href="https://pantheon.io/docs/articles/sites/apache-solr/">activate Solr</a> in your Pantheon Dashboard.', 'solr-for-wordpress-on-pantheon' ),
92+
array(
9193
'a' => array(
9294
'href' => array(),
9395
),
@@ -278,7 +280,9 @@ public function add_scripts() {
278280
$allow_ajax = isset( $solr_options['allow_ajax'] ) ? boolval( $solr_options['allow_ajax'] ) : false;
279281
$div_id = isset( $solr_options['ajax_div_id'] ) ? esc_html( $solr_options['ajax_div_id'] ) : false;
280282
wp_localize_script(
281-
'Solr_Facet', 'solr', array(
283+
'Solr_Facet',
284+
'solr',
285+
array(
282286
'ajaxurl' => admin_url( 'admin-ajax.php' ),
283287
'allow_ajax' => $allow_ajax,
284288
'search_results_id' => $div_id,
@@ -294,7 +298,8 @@ public function add_scripts() {
294298
public function ajax_search() {
295299
// Strip out admin-ajax from pagination links.
296300
add_filter(
297-
'paginate_links', function ( $url ) {
301+
'paginate_links',
302+
function ( $url ) {
298303
$url = str_replace( 'wp-admin/admin-ajax.php', '', $url );
299304
$url = remove_query_arg( 'action', $url );
300305

@@ -374,7 +379,8 @@ public function ajax_search() {
374379
*/
375380
public static function get_post_types() {
376381
return apply_filters(
377-
'solr_post_types', get_post_types(
382+
'solr_post_types',
383+
get_post_types(
378384
array(
379385
'exclude_from_search' => false,
380386
)

0 commit comments

Comments
 (0)