Skip to content

Commit 5f35f5a

Browse files
committed
Added base exception
1 parent cfebefd commit 5f35f5a

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "okapi/singleton",
33
"description": "PHP Singleton is a PHP library that allows you to create singleton classes with a trait.",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"type": "library",
66
"homepage": "https://github.com/okapi-web/php-singleton",
77
"license": "MIT",

src/Exceptions/AlreadyInitializedException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
namespace Okapi\Singleton\Exceptions;
44

5-
use RuntimeException;
6-
75
/**
86
* # Already Initialized Exception
97
*
108
* This exception is thrown when a singleton instance is already initialized.
119
*/
12-
class AlreadyInitializedException extends RuntimeException
10+
class AlreadyInitializedException extends SingletonException
1311
{
1412
/**
1513
* AlreadyInitializedException constructor.

src/Exceptions/NotInitializedException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
namespace Okapi\Singleton\Exceptions;
44

5-
use RuntimeException;
6-
75
/**
86
* # Not Initialized Exception
97
*
108
* This exception is thrown when a singleton is not initialized.
119
*/
12-
class NotInitializedException extends RuntimeException
10+
class NotInitializedException extends SingletonException
1311
{
1412
/**
1513
* NotInitializedException constructor.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Okapi\Singleton\Exceptions;
4+
5+
use RuntimeException;
6+
7+
/**
8+
* # Singleton exception
9+
*
10+
* Base class for all singleton exceptions.
11+
*/
12+
abstract class SingletonException extends RuntimeException
13+
{
14+
}

0 commit comments

Comments
 (0)