From d2323ece5fd1e4b156e5001c386ed39032775446 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Thu, 2 Dec 2021 13:03:24 +0300 Subject: [PATCH] Changed service provider --- src/Concerns/BaseServiceProvider.php | 14 ++------- .../ProviderNotDefinedException.php | 30 ------------------- 2 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 src/Exceptions/ProviderNotDefinedException.php diff --git a/src/Concerns/BaseServiceProvider.php b/src/Concerns/BaseServiceProvider.php index 41185e76..ee6a167a 100644 --- a/src/Concerns/BaseServiceProvider.php +++ b/src/Concerns/BaseServiceProvider.php @@ -22,11 +22,10 @@ use DragonCode\Support\Facades\Helpers\Ables\Arrayable; use Illuminate\Support\ServiceProvider; use LaravelLang\Publisher\Constants\Config; -use LaravelLang\Publisher\Exceptions\ProviderNotDefinedException; -class BaseServiceProvider extends ServiceProvider +abstract class BaseServiceProvider extends ServiceProvider { - protected $provider; + abstract protected function getProvider(): string; public function register(): void { @@ -42,15 +41,6 @@ protected function registerProvider(): void $this->setConfig($plugins); } - protected function getProvider(): string - { - if ($this->provider) { - return $this->provider; - } - - throw new ProviderNotDefinedException(); - } - protected function push(array $plugins): array { return Arrayable::of($plugins) diff --git a/src/Exceptions/ProviderNotDefinedException.php b/src/Exceptions/ProviderNotDefinedException.php deleted file mode 100644 index f605df40..00000000 --- a/src/Exceptions/ProviderNotDefinedException.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * @copyright 2021 Andrey Helldar - * - * @license MIT - * - * @see https://github.com/Laravel-Lang/publisher - */ - -declare(strict_types=1); - -namespace LaravelLang\Publisher\Exceptions; - -use RuntimeException; - -class ProviderNotDefinedException extends RuntimeException -{ - public function __construct() - { - parent::__construct('Provider class not defined.'); - } -}