Test Failed
Pull Request — master (#61)
by
unknown
03:25
created

ResponseBodyTokenSetterEventListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 12
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A onAddToken() 0 6 1
1
<?php 
2
3
/*
4
 * This file is part of the GesdinetJWTRefreshTokenBundle package.
5
 *
6
 * (c) Gesdinet <http://www.gesdinet.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Gesdinet\JWTRefreshTokenBundle\EventListener\TokenSetter;
13
14
use Gesdinet\JWTRefreshTokenBundle\Event\AddTokenResponseEvent;
15
16
class ResponseBodyTokenSetterEventListener {
17
	private $name;
18
	public function __construct($name){
19
		$this->name = $name;
20
	}
21
	public function onAddToken(AddTokenResponseEvent $event){
22
		$token = $event->getToken();
23
		$data = $event->getData();
24
		$data[$this->name] = $token;
25
		$event->setData($data);
26
	}
27
}