Symfony   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 25
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A all() 0 4 1
A get() 0 4 1
A csrf() 0 4 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
}