Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare( strict_types = 1 );
3
4/**
5 * Interface for destructible services.
6 *
7 * @license GPL-2.0-or-later
8 * @file
9 */
10
11namespace Wikimedia\Services;
12
13/**
14 * DestructibleService defines a standard interface for shutting down a service instance.
15 * The intended use is for a service container to be able to shut down services that should
16 * no longer be used, and allow such services to release any system resources.
17 *
18 * @note There is no expectation that services will be destroyed when the process (or web request)
19 * terminates.
20 */
21interface DestructibleService {
22
23    /**
24     * Notifies the service object that it should expect to no longer be used, and should release
25     * any system resources it may own. The behavior of all service methods becomes undefined after
26     * destroy() has been called. It is recommended that implementing classes should throw an
27     * exception when service methods are accessed after destroy() has been called.
28     */
29    public function destroy();
30
31}