App   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 9
c 2
b 0
f 0
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test() 0 5 1
A error() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
namespace Source\Controllers;
4
5
use stdClass;
6
use Source\Core\Request;
7
use Source\Core\Response;
8
use Source\Models\Product;
9
use Source\Models\Category;
10
11
class App
12
{
13
    private $Message;
14
15
    private $Request;
16
17
    public function __construct()
18
    {
19
        $this->Message = new stdClass();
20
        $this->Request = new Request();
21
    }
22
23
    public function test()
24
    {
25
        $this->Message->message = 'this is a test';
26
27
        (new Response())->setStatusCode(HTTP_OK)->send($this->Message);
28
    }
29
30
    public function error($data)
0 ignored issues
show
Unused Code introduced by
The parameter $data 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

30
    public function error(/** @scrutinizer ignore-unused */ $data)

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...
31
    {
32
        $this->Message->message = '404 Not Found';
33
34
        (new Response())->setStatusCode(HTTP_NOT_FOUND)->send($this->Message);
35
    }
36
}
37