Passed
Push — master ( 169926...ba6cf3 )
by Stiofan
22s
created

WPInv_Privacy::get_privacy_message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Privacy/GDPR related functionality which ties into WordPress functionality.
4
 */
5
6
defined( 'ABSPATH' ) || exit;
7
8
/**
9
 * WPInv_Privacy Class.
10
 */
11
class WPInv_Privacy extends WPInv_Abstract_Privacy {
12
13
    /**
14
     * Init - hook into events.
15
     */
16
    public function __construct() {
17
        parent::__construct( __( 'Invoicing', 'invoicing' ) );
18
19
        // Include supporting classes.
20
        include_once 'class-wpinv-privacy-exporters.php';
21
22
        // This hook registers Invoicing data exporters.
23
        $this->add_exporter( 'wpinv-customer-invoices', __( 'Customer Invoices', 'invoicing' ), array( 'WPInv_Privacy_Exporters', 'customer_invoice_data_exporter' ) );
0 ignored issues
show
Documentation introduced by
array('WPInv_Privacy_Exp...invoice_data_exporter') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
24
    }
25
26
    /**
27
     * Add privacy policy content for the privacy policy page.
28
     *
29
     * @since 3.4.0
30
     */
31
    public function get_privacy_message() {
32
        $content = '
33
			<div contenteditable="false">' .
34
            '<p class="wp-policy-help">' .
35
            __( 'Invoicing uses the following privacy.', 'invoicing' ) .
36
            '</p>' .
37
            '</div>';
38
39
        return apply_filters( 'wpinv_privacy_policy_content', $content );
40
    }
41
42
}
43
44
new WPInv_Privacy();
45