diff --git a/composer.json b/composer.json index 1f9adb21..0982b366 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ "php": "^8.2", "illuminate/contracts": "^11.0", "laravel/prompts": "^0.1.10", - "laravel/socialite": "^5.12", - "webmozart/assert": "^1.11" + "laravel/socialite": "^5.12" }, "require-dev": { "laravel/breeze": "^2.0", diff --git a/src/Data/ProviderData.php b/src/Data/ProviderData.php index 491aa9fc..1ac464b3 100644 --- a/src/Data/ProviderData.php +++ b/src/Data/ProviderData.php @@ -4,7 +4,6 @@ use JoelButcher\Socialstream\Enums\ProviderEnum; use JoelButcher\Socialstream\Providers; -use Webmozart\Assert\Assert; /** * @internal @@ -16,15 +15,23 @@ private function __construct( public readonly string $name, public readonly ?string $buttonLabel = null, ) { - Assert::stringNotEmpty($id); - Assert::stringNotEmpty($name); + if ($id === '') { + throw new \InvalidArgumentException('Expected a different value than \'\''); + } + if ($name === '') { + throw new \InvalidArgumentException('Expected a different value than \'\''); + } } public static function from(ProviderEnum|string|array $provider): self { if (is_array($provider)) { - Assert::keyExists($provider, 'id'); - Assert::keyExists($provider, 'name'); + if (! array_key_exists('id', $provider)) { + throw new \InvalidArgumentException('Expected the key \'id\' to exist'); + } + if (! array_key_exists('name', $provider)) { + throw new \InvalidArgumentException('Expected the key \'name\' to exist'); + } } return match (true) {