listener::getSubscribedEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/**
4
*
5
* @package phpBB Extension - Paypal
6
* @copyright (c) 2015 tas2580 (https://tas2580.net)
7
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8
*
9
*/
10
11
namespace tas2580\paypal\event;
12
13
/**
14
* @ignore
15
*/
16
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17
18
/**
19
* Event listener
20
*/
21
class listener implements EventSubscriberInterface
22
{
23
	static public function getSubscribedEvents()
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
24
	{
25
		return array(
26
			'core.page_header'		=> 'page_header',
27
		);
28
	}
29
30
	/** @var \phpbb\controller\helper */
31
	protected $helper;
32
33
	/** @var \phpbb\template\template */
34
	protected $template;
35
36
	/**@var \phpbb\user */
37
	protected $user;
38
39
	/**
40
	* Constructor
41
	*
42
	* @param \phpbb\controller\helper		$helper			Controller helper object
43
	* @param \phpbb\template				$template		Template object
44
	* @param \phpbb\user					$user			User object
45
	*/
46
	public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user)
47
	{
48
		$this->helper = $helper;
49
		$this->template = $template;
50
		$this->user = $user;
51
	}
52
53
	public function page_header()
54
	{
55
		$this->user->add_lang_ext('tas2580/paypal', 'link');
56
		$this->template->assign_vars(array(
57
			'U_PAYPAL'	=> $this->helper->route('tas2580_paypal_controller', array()),
58
		));
59
	}
60
}
61