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

AddTokenResponseEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 19
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getToken() 0 3 1
A getResponse() 0 3 1
A setData() 0 3 1
A getData() 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\Response;
14
use Symfony\Component\EventDispatcher\Event;
15
16
class AddTokenResponseEvent extends Event {
17
	private $data = [];
18
	public function __construct($token, Response $response){
19
		$this->token = $token;
0 ignored issues
show
Bug introduced by
The property token 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
		$this->response = $response;
0 ignored issues
show
Bug introduced by
The property response 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...
21
	}
22
	public function getToken(){
23
		return $this->token;
24
	}
25
	public function getResponse(){
26
		return $this->response;
27
	}
28
	public function setData(array $data){
29
		$this->data = $data;
30
	}
31
	public function getData(){
32
		return $this->data;
33
	}
34
}