getset::getGet()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 6
rs 10
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