GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Nip_Helper_Async::html()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
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 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
class Nip_Helper_Async extends Nip\Helpers\AbstractHelper
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
{
4
	
5
	public function sendMessage($message, $type = 'success', $format ='json')
6
	{
7
        $data = array(
8
            'type' => $type,
9
            'message' => $message,
10
            );
11
        return $this->$format($data);
12
	}
13
	
14
	public function json($data)
15
	{
16
		header("Content-type: text/x-json");
17
		echo(is_string($data) ? $data : json_encode($data));
18
		exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The method json() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
19
	}
20
21
	public function txt($data)
22
	{
23
		header("Content-type: text/plain");
24
		echo($data);
25
		exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The method txt() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
26
	}
27
28
	public function html($data)
29
	{
30
		header("Content-type: text/html");
31
		echo($data);
32
		exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The method html() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
33
	}
34
}