Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
kernel_terminate_subscriber
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 on_kernel_terminate
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getSubscribedEvents
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
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
14namespace phpbb\event;
15
16use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17use Symfony\Component\HttpKernel\KernelEvents;
18use Symfony\Component\HttpKernel\Event\TerminateEvent;
19
20class kernel_terminate_subscriber implements EventSubscriberInterface
21{
22    /**
23    * This listener is run when the KernelEvents::TERMINATE event is triggered
24    * This comes after a Response has been sent to the server; this is
25    * primarily cleanup stuff.
26    *
27    * @param TerminateEvent $event
28    * @return void
29    */
30    public function on_kernel_terminate(TerminateEvent $event)
31    {
32        garbage_collection();
33
34        exit_handler();
35    }
36
37    public static function getSubscribedEvents()
38    {
39        return array(
40            KernelEvents::TERMINATE        => array('on_kernel_terminate', ~PHP_INT_MAX),
41        );
42    }
43}