Skip to content

Commit

Permalink
[6.x] Fix PHP 8.4 deprecation warnings for implicit nullable types (#376
Browse files Browse the repository at this point in the history
)
  • Loading branch information
selfsimilar authored Sep 30, 2024
1 parent b09c221 commit d1c5cde
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Installer/InstallManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use JoelButcher\Socialstream\Installer\Drivers\Jetstream\LivewireDriver as JetstreamLivewireDriver;

/**
* @method Driver driver($driver = null)
* @method Driver driver(?string $driver = null)
*/
class InstallManager extends Manager
{
Expand Down
24 changes: 12 additions & 12 deletions src/Providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,63 +152,63 @@ public static function hasTwitterOAuth2Support(): bool
/**
* Enable the Bitbucket provider.
*/
public static function bitbucket(string $label = null): string
public static function bitbucket(?string $label = null): string
{
return tap(ProviderEnum::Bitbucket->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the Facebook provider.
*/
public static function facebook(string $label = null): string
public static function facebook(?string $label = null): string
{
return tap(ProviderEnum::Facebook->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the GitHub provider.
*/
public static function github(string $label = null): string
public static function github(?string $label = null): string
{
return tap(ProviderEnum::Github->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the GitLab provider.
*/
public static function gitlab(string $label = null): string
public static function gitlab(?string $label = null): string
{
return tap(ProviderEnum::Gitlab->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the Google provider.
*/
public static function google(string $label = null): string
public static function google(?string $label = null): string
{
return tap(ProviderEnum::Google->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the LinkedIn provider.
*/
public static function linkedin(string $label = null): string
public static function linkedin(?string $label = null): string
{
return tap(ProviderEnum::LinkedIn->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the LinkedIn OpenID provider.
*/
public static function linkedinOpenId(string $label = null): string
public static function linkedinOpenId(?string $label = null): string
{
return tap(ProviderEnum::LinkedInOpenId->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the Slack provider.
*/
public static function slack(string $label = null): string
public static function slack(?string $label = null): string
{
return tap(ProviderEnum::Slack->value, fn (string $provider) => static::addLabelFor($provider, $label));
}
Expand All @@ -218,28 +218,28 @@ public static function slack(string $label = null): string
*
* @deprecated use `twitterOAuth1` instead.
*/
public static function twitter(string $label = null): string
public static function twitter(?string $label = null): string
{
return tap(ProviderEnum::Twitter->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the Twitter OAuth 1.0 provider.
*/
public static function twitterOAuth1(string $label = null): string
public static function twitterOAuth1(?string $label = null): string
{
return tap(ProviderEnum::Twitter->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

/**
* Enable the Twitter OAuth 2.0 provider.
*/
public static function twitterOAuth2(string $label = null): string
public static function twitterOAuth2(?string $label = null): string
{
return tap(ProviderEnum::TwitterOAuth2->value, fn (string $provider) => static::addLabelFor($provider, $label));
}

public static function addLabelFor(ProviderEnum|string $provider, string $label = null): void
public static function addLabelFor(ProviderEnum|string $provider, ?string $label = null): void
{
if (! $label) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Socialstream.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function providers(): array
/**
* Get a completion redirect path for a specific feature.
*/
public static function redirects(string $redirect, $default = null)
public static function redirects(string $redirect, mixed $default = null)
{
return config('socialstream.redirects.'.$redirect) ?? $default ?? config('socialstream.home');
}
Expand Down
2 changes: 1 addition & 1 deletion stubs/breeze/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function unverified(): static
/**
* Indicate that the user should have a connected account for the given provider.
*/
public function withConnectedAccount(string $provider, callable $callback = null): static
public function withConnectedAccount(string $provider, ?callable $callback = null): static
{
if (! Providers::enabled($provider)) {
return $this->state([]);
Expand Down
2 changes: 1 addition & 1 deletion stubs/filament/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function unverified(): static
/**
* Indicate that the user should have a connected account for the given provider.
*/
public function withConnectedAccount(string $provider, callable $callback = null): static
public function withConnectedAccount(string $provider, ?callable $callback = null): static
{
if (! Providers::enabled($provider)) {
return $this->state([]);
Expand Down
4 changes: 2 additions & 2 deletions stubs/jetstream/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function unverified(): static
/**
* Indicate that the user should have a personal team.
*/
public function withPersonalTeam(callable $callback = null): static
public function withPersonalTeam(?callable $callback = null): static
{
if (! JetstreamFeatures::hasTeamFeatures()) {
return $this->state([]);
Expand All @@ -69,7 +69,7 @@ public function withPersonalTeam(callable $callback = null): static
/**
* Indicate that the user should have a connected account for the given provider.
*/
public function withConnectedAccount(string $provider, callable $callback = null): static
public function withConnectedAccount(string $provider, ?callable $callback = null): static
{
if (! Providers::enabled($provider)) {
return $this->state([]);
Expand Down

0 comments on commit d1c5cde

Please sign in to comment.