3 namespace Wikimedia\Services
;
9 * Exception thrown when a service was already defined, but the
10 * caller expected it to not exist.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 * http://www.gnu.org/copyleft/gpl.html
33 * Exception thrown when a service was already defined, but the
34 * caller expected it to not exist.
36 class ServiceAlreadyDefinedException
extends RuntimeException
{
39 * @param string $serviceName
40 * @param Exception|null $previous
42 public function __construct( $serviceName, Exception
$previous = null ) {
43 parent
::__construct( "Service already defined: $serviceName", 0, $previous );
49 * Retain the old class name for backwards compatibility.
50 * @deprecated since 1.33
52 class_alias( ServiceAlreadyDefinedException
::class,
53 'MediaWiki\Services\ServiceAlreadyDefinedException' );