blog   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 22
c 1
b 0
f 0
dl 0
loc 73
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A scope() 0 3 1
A register() 0 6 1
A settings() 0 3 1
A headerMethods() 0 5 1
A run() 0 18 1
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 blog 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->setAllowedMethods(
38
            ['GET', 'POST']
39
        );
40
    }
41
42
    /**
43
     * [register]
44
     * @return array
45
     */
46
    public function register()
47
    {
48
        return array(
49
            '/blog/article/{blogId}',
50
            '/blog/post/{blogId}',
51
            '/blog/post/{year}/{month}/{day}/{blogSlug}',
52
        );
53
    }
54
55
    /**
56
     * [scope Routing scope access]
57
     * @return string
58
     */
59
    public function scope()
60
    {
61
        return 'private';
62
    }
63
64
    /**
65
     * [run Run the method request]
66
     * @return array
67
     */
68
    public function run()
69
    {
70
        return array(
71
            'testing' =>
72
            [
73
                'response' => 'Responsible works',
74
75
                'deepArray' => [
76
                    'works' => ['sure', 'does'],
77
                ],
78
                'deepArray2' => [
79
                    'works' => 'sure does',
80
                ],
81
                'deepArray3' => [
82
                    'works' => 'sure does',
83
                ],
84
                'deepArray4' => [
85
                    'works' => 'sure does',
86
                ],
87
            ],
88
            // 'responsibleCore' => $this->responsible,
89
        );
90
    }
91
}
92