Completed
Push — master ( 10575c...1b914b )
by Korotkov
04:08 queued 02:36
created

Server::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Jagepard <[email protected]">
7
 * @copyright Copyright (c) 2019, Jagepard
8
 * @license   https://mit-license.org/ MIT
9
 */
10
11
namespace Rudra\Container\Request;
12
13
use Rudra\Container\AbstractContainer;
14
15
class Server extends AbstractContainer
16
{
17
    /**
18
     * @param  string|null  $key
19
     * @return array|null
20
     */
21
    public function get(string $key = null)
22
    {
23
        if (isset($key)) {
24
            return $this->data[$key] ?? null;
25
        }
26
27
        return $this->data;
28
    }
29
30
    /**
31
     * @param  string  $key
32
     * @param  string  $value
33
     */
34
    public function setValue(string $key, string $value)
35
    {
36
        $this->data[$key] = $value;
37
    }
38
}
39