Passed
Push — master ( 3a3f23...fdc038 )
by litefeel
02:23
created

function.php ➔ wogh_equal_front_matter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
4
/**
5
 * Append error
6
 * @param  mixed|WP_Error $error
7
 * @param  WP_Error   $error2
8
 * @return WP_Error
9
 */
10
function wogh_append_error( $error, $error2 ) {
11
    if ( is_wp_error( $error ) ) {
12
        $error->add( $error2->get_error_code(), $error2->get_error_message() );
13
    }
14
    return $error2;
15
}
16
17
/**
18
 * Test is equal front matter of post and blob
19
 * @param  Writing_On_GitHub_Post $post
20
 * @param  Writing_On_GitHub_Blob $blob
21
 * @return bool
22
 */
23
function wogh_equal_front_matter( $post, $blob ) {
24
    $str1 = $post->front_matter();
25
    $str2 = $blob->front_matter();
26
    return trim($str1) === trim($str2);
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after opening bracket; 0 found
Loading history...
Coding Style introduced by
Expected 1 spaces before closing bracket; 0 found
Loading history...
27
}
28