Test Failed
Pull Request — master (#62)
by
unknown
05:03
created

GetTokenRequestEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getRequest() 0 3 1
A setToken() 0 3 1
A getToken() 0 3 1
1
<?php 
2
/*
3
 * This file is part of the GesdinetJWTRefreshTokenBundle package.
4
 *
5
 * (c) Gesdinet <http://www.gesdinet.com/>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Gesdinet\JWTRefreshTokenBundle\Event;
12
13
use Symfony\Component\HttpFoundation\Request;
14
use Symfony\Component\EventDispatcher\Event;
15
16
class GetTokenRequestEvent extends Event {
17
	private $token = null;
18
	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...
19
		$this->request = $request;
0 ignored issues
show
Bug introduced by
The property request does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
20
	}
21
	public function getRequest(){
22
		return $this->request;
23
	}
24
	public function setToken($token){
25
		$this->token = $token;
26
	}
27
	public function getToken(){
28
		return $this->token;
29
	}
30
}