WPInv_Meta_Box_Notes   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
c 0
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A output() 0 28 3
1
<?php
2
// MUST have WordPress.
3
if ( ! defined( 'WPINC' ) ) {
4
    exit;
5
}
6
7
class WPInv_Meta_Box_Notes {
8
    public static function output( $post ) {
0 ignored issues
show
Unused Code introduced by
The parameter $post is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

8
    public static function output( /** @scrutinizer ignore-unused */ $post ) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
9
        global $post;
10
11
        $notes = wpinv_get_invoice_notes( $post->ID );
12
13
        echo '<ul class="invoice_notes">';
14
15
        if ( $notes ) {
16
            foreach ( $notes as $note ) {
17
                wpinv_get_invoice_note_line_item( $note );
18
            }
19
} else {
20
            echo '<li>' . esc_html__( 'There are no notes yet.', 'invoicing' ) . '</li>';
21
        }
22
23
        echo '</ul>';
24
        ?>
25
        <div class="add_note">
26
            <h4><?php esc_html_e( 'Add note', 'invoicing' ); ?></h4>
27
            <p>
28
                <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea>
29
            </p>
30
            <p>
31
                <select name="invoice_note_type" id="invoice_note_type" class="regular-text">
32
                    <option value=""><?php esc_html_e( 'Private note', 'invoicing' ); ?></option>
33
                    <option value="customer"><?php esc_html_e( 'Note to customer', 'invoicing' ); ?></option>
34
                </select>
35
                <a href="#" class="add_note button"><?php esc_html_e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php esc_html_e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span>
36
            </p>
37
        </div>
38
        <?php
39
    }
40
}
41