IndexRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 20
rs 10
ccs 7
cts 7
cp 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUsername() 0 5 1
A getPassword() 0 4 1
1
<?php
2
3
namespace OpenTribes\Core\Silex\Request;
4
5
6
use OpenTribes\Core\Request\LoginRequest;
7
use Symfony\Component\HttpFoundation\Request;
8
9
class IndexRequest implements LoginRequest{
10
    private $request;
11
12 9
    public function __construct(Request $request)
0 ignored issues
show
Bug introduced by
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
13
    {
14 9
        $this->request = $request;
15 9
    }
16
17 8
    public function getUsername()
18
    {
19
20 8
      return  $this->request->get('username','');
21
    }
22
23 8
    public function getPassword()
24
    {
25 8
        return $this->request->get('password','');
26
    }
27
28
}