Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| permission | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| getSubscribedEvents | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| add_permissions | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | namespace foo\bar\event; |
| 15 | |
| 16 | /** |
| 17 | * Event listener |
| 18 | */ |
| 19 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
| 20 | |
| 21 | class permission implements EventSubscriberInterface |
| 22 | { |
| 23 | static public function getSubscribedEvents() |
| 24 | { |
| 25 | return array( |
| 26 | 'core.permissions' => 'add_permissions', |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | public function add_permissions($event) |
| 31 | { |
| 32 | $permissions = $event['permissions']; |
| 33 | $permissions['u_foo'] = array('lang' => 'ACL_U_FOOBAR', 'cat' => 'post'); |
| 34 | $event['permissions'] = $permissions; |
| 35 | } |
| 36 | } |