Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 3b4b425

Browse files
committed
WordPress coding style
1 parent 1735759 commit 3b4b425

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

handler/semantic-linkbacks-microformats-handler.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ public static function get_representative_entry( $entries, $target ) {
305305
if ( 'content' == $key &&
306306
preg_match_all( '/<a[^>]+?' . preg_quote( $target, '/' ) . '[^>]*>([^>]+?)<\/a>/i', $values[0]['html'], $context ) ) {
307307
return $entry;
308-
}
309-
// check summary for the link
310-
elseif ( 'summary' == $key &&
308+
} elseif ( 'summary' == $key &&
311309
preg_match_all( '/<a[^>]+?' . preg_quote( $target, '/' ) . '[^>]*>([^>]+?)<\/a>/i', $values[0], $context ) ) {
312310
return $entry;
313311
}
@@ -336,7 +334,7 @@ public static function get_entry_type( $target, $entry, $mf_array = array() ) {
336334
if ( in_array( $key, array_keys( $classes ) ) ) {
337335
// check "normal" links
338336
if ( self::compare_urls( $target, $values ) ) {
339-
return $classes[$key];
337+
return $classes[ $key ];
340338
}
341339

342340
// iterate in-reply-tos
@@ -347,7 +345,7 @@ public static function get_entry_type( $target, $entry, $mf_array = array() ) {
347345
if ( isset( $obj['properties'] ) && isset( $obj['properties']['url'] ) ) {
348346
// check target
349347
if ( self::compare_urls( $target, $obj['properties']['url'] ) ) {
350-
return $classes[$key];
348+
return $classes[ $key ];
351349
}
352350
}
353351
}
@@ -368,7 +366,7 @@ public static function get_entry_type( $target, $entry, $mf_array = array() ) {
368366
if ( in_array( $key, array_keys( $rels ) ) ) {
369367
foreach ( $values as $value ) {
370368
if ( $value == $target ) {
371-
return $rels[$key];
369+
return $rels[ $key ];
372370
}
373371
}
374372
}
@@ -386,7 +384,7 @@ public static function get_entry_type( $target, $entry, $mf_array = array() ) {
386384
* @return boolean
387385
*/
388386
public static function check_mf_attr($key, $node) {
389-
if ( isset( $node[$key] ) && isset( $node[$key][0] ) ) {
387+
if ( isset( $node[ $key ] ) && isset( $node[ $key ][0] ) ) {
390388
return true;
391389
}
392390

semantic-linkbacks.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// version is required by the mf2 parser
1414
function semantic_linkbacks_activation() {
1515
if ( version_compare( phpversion(), 5.3, '<' ) ) {
16-
die('The minimum PHP version required for this plugin is 5.3');
16+
die( 'The minimum PHP version required for this plugin is 5.3' );
1717
}
1818
}
1919
register_activation_hook( __FILE__, 'semantic_linkbacks_activation' );
@@ -153,7 +153,7 @@ public static function linkback_fix( $comment_ID ) {
153153
foreach ( $commentdata as $key => $value ) {
154154
if ( 0 === strpos( $key, '_' ) ) {
155155
update_comment_meta( $commentdata['comment_ID'], 'semantic_linkbacks'.$key, $value, true );
156-
unset( $commentdata[$key] );
156+
unset( $commentdata[ $key ] );
157157
}
158158
}
159159

@@ -188,7 +188,7 @@ public static function get_comment_type_excerpts() {
188188
'rsvp:no' => __( '%1$s is <strong>not attending</strong>', 'semantic_linkbacks' ),
189189
'rsvp:maybe' => __( 'Maybe %1$s will be <strong>attending</strong>', 'semantic_linkbacks' ),
190190
'rsvp:invited' => __( '%1$s is <strong>invited</strong>', 'semantic_linkbacks' ),
191-
'rsvp:tracking' => __( '%1$s <strong>tracks</strong> this event', 'semantic_linkbacks' )
191+
'rsvp:tracking' => __( '%1$s <strong>tracks</strong> this event', 'semantic_linkbacks' ),
192192
);
193193

194194
return $strings;
@@ -213,7 +213,7 @@ public static function get_comment_type_strings() {
213213
'rsvp:no' => __( 'RSVP', 'semantic_linkbacks' ),
214214
'rsvp:invited' => __( 'RSVP', 'semantic_linkbacks' ),
215215
'rsvp:maybe' => __( 'RSVP', 'semantic_linkbacks' ),
216-
'rsvp:tracking' => __( 'RSVP', 'semantic_linkbacks' )
216+
'rsvp:tracking' => __( 'RSVP', 'semantic_linkbacks' ),
217217
);
218218

219219
return $strings;
@@ -237,7 +237,7 @@ public static function get_post_format_strings() {
237237
'quote' => __( 'this Quote', 'semantic_linkbacks' ),
238238
'status' => __( 'this Status', 'semantic_linkbacks' ),
239239
'video' => __( 'this Video', 'semantic_linkbacks' ),
240-
'audio' => __( 'this Audio', 'semantic_linkbacks' )
240+
'audio' => __( 'this Audio', 'semantic_linkbacks' ),
241241
);
242242

243243
return $strings;
@@ -333,7 +333,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
333333

334334
// get post type
335335
$post_formatstrings = self::get_post_format_strings();
336-
$post_type = $post_formatstrings[$post_format];
336+
$post_type = $post_formatstrings[ $post_format ];
337337

338338
$post_type = apply_filters( 'semantic_linkbacks_post_type', $post_type, $comment->comment_post_ID );
339339

@@ -348,7 +348,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
348348
$host = preg_replace( '/^www\./', '', $host );
349349

350350
// generate output
351-
$text = sprintf( $comment_type_excerpts[$semantic_linkbacks_type], get_comment_author_link( $comment->comment_ID ), $post_type, $url, $host );
351+
$text = sprintf( $comment_type_excerpts[ $semantic_linkbacks_type ], get_comment_author_link( $comment->comment_ID ), $post_type, $url, $host );
352352

353353
return apply_filters( 'semantic_linkbacks_excerpt', $text );
354354
}
@@ -362,7 +362,7 @@ public static function comment_text_excerpt( $text, $comment = null, $args = arr
362362
*/
363363
public static function pre_get_avatar_data($args, $id_or_email) {
364364
if ( ! isset( $args['class'] ) ) {
365-
$args['class'] = array('u-photo');
365+
$args['class'] = array( 'u-photo' );
366366
} else {
367367
$args['class'][] = 'u-photo';
368368
}
@@ -429,7 +429,7 @@ public static function comment_class( $classes, $class, $comment_id, $post_id )
429429

430430
// "comment type to class" mapper
431431
$class_mapping = array(
432-
'mention' => array( 'h-as-mention'),
432+
'mention' => array( 'h-as-mention' ),
433433

434434
'reply' => array( 'h-as-reply' ),
435435
'repost' => array( 'h-as-repost', 'p-repost' ),
@@ -440,14 +440,14 @@ public static function comment_class( $classes, $class, $comment_id, $post_id )
440440
'rsvp:no' => array( 'h-as-rsvp' ),
441441
'rsvp:maybe' => array( 'h-as-rsvp' ),
442442
'rsvp:invited' => array( 'h-as-rsvp' ),
443-
'rsvp:tracking' => array( 'h-as-rsvp' )
443+
'rsvp:tracking' => array( 'h-as-rsvp' ),
444444
);
445445

446446
$semantic_linkbacks_type = get_comment_meta( $comment->comment_ID, 'semantic_linkbacks_type', true );
447447

448448
// check the comment type
449-
if ( $semantic_linkbacks_type && isset( $class_mapping[$semantic_linkbacks_type] ) ) {
450-
$classes = array_merge( $classes, $class_mapping[$semantic_linkbacks_type] );
449+
if ( $semantic_linkbacks_type && isset( $class_mapping[ $semantic_linkbacks_type ] ) ) {
450+
$classes = array_merge( $classes, $class_mapping[ $semantic_linkbacks_type ] );
451451

452452
$classes = array_unique( $classes );
453453
}

0 commit comments

Comments
 (0)