Symfony::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php 
2
3
namespace Helmut\Forms\Requests;
4
5
use Helmut\Forms\Request;
6
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
7
8
class Symfony implements Request {
9
    
10
    protected $request;
11
12
    public function __construct()
13
    {
14
        $this->request = SymfonyRequest::createFromGlobals();
15
    }
16
17
    public function all()
18
    {
19
        return $this->request->request->all();
20
    }
21
22
    public function get($key)
23
    {
24
        return $this->request->request->get($key);
25
    }
26
27
    public function csrf()
28
    {
29
        return ['name' => '_token', 'value' => csrf_token()];
30
    }
31
32
}