getset   A
last analyzed

Complexity

Total Complexity 16

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
c 1
b 0
f 0
dl 0
loc 69
ccs 0
cts 27
cp 0
rs 10
wmc 16

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setServer() 0 4 3
A getPost() 0 4 2
A getServer() 0 4 2
A logoutSession() 0 4 1
A getGet() 0 4 2
A setPost() 0 4 3
A setGet() 0 4 3
1
<?php
2
3
namespace Aiur18\getset;
4
5
6
7
/**
8
 * A database driven model using the Active Record design pattern.
9
 */
10
class getset
11
{
12
13
14
    /** Method
15
     */
16
    function getGet($key)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
17
    {
18
        if (isset($_GET[$key])) {
19
            return $_GET[$key];
20
        }
21
    }
22
23
24
    /** Method
25
     */
26
    function setGet($key, $value)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
27
    {
28
        if ($key != null && $value != null) {
29
            $_GET[$key] = $value;
30
        }
31
    }
32
33
34
    /** Method
35
     */
36
    function getPost($key)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
37
    {
38
        if (isset($_POST[$key])) {
39
            return $_POST[$key];
40
        }
41
    }
42
43
44
    /** Method
45
     */
46
    function setPost($key, $value)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
47
    {
48
        if ($key != null && $value != null) {
49
            $_POST[$key] = $value;
50
        }
51
    }
52
53
    /** Method
54
     */
55
    function getServer($key)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
56
    {
57
        if (isset($_SESSION[$key])) {
58
            return $_SESSION[$key];
59
        }
60
    }
61
62
63
    /** Method
64
     */
65
    function setServer($key, $value)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
66
    {
67
        if ($key != null && $value != null) {
68
            $_SESSION[$key] = $value;
69
        }
70
    }
71
72
      /**
73
     * Method
74
     */
75
    public function logoutSession()
76
    {
77
        session_destroy();
78
        session_start();
79
    }
80
81
}
82