mock::settings()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * ASSETS ENDPOINT CLASS
5
 *
6
 */
7
namespace responsible\service\endpoints;
8
9
use responsible\core\headers;
10
use responsible\service\interfaces;
11
use responsible\core\exception;
12
13
class mock implements interfaces\endpointsInterface
14
{
15
    /**
16
     * [$settings]
17
     * @var array
18
     */
19
    private $settings = [];
20
21
    /**
22
     * [settings Inherited settings]
23
     * @return void
24
     */
25
    public function settings(array $settings)
26
    {
27
        $this->settings = $settings;
28
    }
29
30
    /**
31
     * [headerMethods]
32
     * @return void
33
     */
34
    public function headerMethods()
35
    {
36
        $headers = new headers\header;
37
        $headers->setOptions($this->responsible->options);
0 ignored issues
show
Bug Best Practice introduced by
The property responsible does not exist on responsible\service\endpoints\mock. Did you maybe forget to declare it?
Loading history...
38
        $headers->setAllowedMethods(
39
            ['GET', 'POST']
40
        );
41
    }
42
43
    /**
44
     * [register]
45
     * @return array
46
     */
47
    public function register()
48
    {
49
        return array(
50
            '/mock',
51
            '/mock/{mockId}',
52
            '/mock/{mockId}/post',
53
            '/mock/{mockId}/public',
54
        );
55
    }
56
57
    /**
58
     * [scope Routing scope access]
59
     * @return string
60
     */
61
    public function scope()
62
    {
63
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array('private', ...'private', 'anonymous') returns the type array<integer,string> which is incompatible with the documented return type string.
Loading history...
64
            'private',
65
            'private',
66
            'private',
67
            'anonymous',
68
        ];
69
    }
70
71
    /**
72
     * [run Run the method request]
73
     * @return array
74
     */
75
    public function run()
76
    {
77
        return ['mock_run' => [
78
            'passed' => true
79
        ]];
80
    }
81
}
82