File tree 2 files changed +13
-7
lines changed
2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 22
22
"php" : " ^8.2" ,
23
23
"illuminate/contracts" : " ^11.0" ,
24
24
"laravel/prompts" : " ^0.1.10" ,
25
- "laravel/socialite" : " ^5.12" ,
26
- "webmozart/assert" : " ^1.11"
25
+ "laravel/socialite" : " ^5.12"
27
26
},
28
27
"require-dev" : {
29
28
"laravel/breeze" : " ^2.0" ,
Original file line number Diff line number Diff line change 4
4
5
5
use JoelButcher \Socialstream \Enums \ProviderEnum ;
6
6
use JoelButcher \Socialstream \Providers ;
7
- use Webmozart \Assert \Assert ;
8
7
9
8
/**
10
9
* @internal
@@ -16,15 +15,23 @@ private function __construct(
16
15
public readonly string $ name ,
17
16
public readonly ?string $ buttonLabel = null ,
18
17
) {
19
- Assert::stringNotEmpty ($ id );
20
- Assert::stringNotEmpty ($ name );
18
+ if ($ id === '' ) {
19
+ throw new \InvalidArgumentException ('Expected a different value than \'\'' );
20
+ }
21
+ if ($ name === '' ) {
22
+ throw new \InvalidArgumentException ('Expected a different value than \'\'' );
23
+ }
21
24
}
22
25
23
26
public static function from (ProviderEnum |string |array $ provider ): self
24
27
{
25
28
if (is_array ($ provider )) {
26
- Assert::keyExists ($ provider , 'id ' );
27
- Assert::keyExists ($ provider , 'name ' );
29
+ if (! array_key_exists ('id ' , $ provider )) {
30
+ throw new \InvalidArgumentException ('Expected the key \'id \' to exist ' );
31
+ }
32
+ if (! array_key_exists ('name ' , $ provider )) {
33
+ throw new \InvalidArgumentException ('Expected the key \'name \' to exist ' );
34
+ }
28
35
}
29
36
30
37
return match (true ) {
You can’t perform that action at this time.
0 commit comments