Skip to content

Commit

Permalink
make implicit nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Jan 27, 2025
1 parent 1e346df commit 4e8ddea
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/Actions/SubscribeUserToNewsletterAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct(private readonly MailcoachApi $mailcoachApi)
{
}

public function execute(User $user = null, string $email = null): User
public function execute(?User $user = null, ?string $email = null): User
{
$email ??= $user->email;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function execute(Purchase $purchase)
$this->mailcoachApi->addTags($subscriber, $tagNames);
}

protected function findOrCreateSubscriber(string $email, string $listUuid = null): ?Subscriber
protected function findOrCreateSubscriber(string $email, ?string $listUuid = null): ?Subscriber
{
if ($subscriber = $this->mailcoachApi->getSubscriber($email, $listUuid)) {
return $subscriber;
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Shop/Actions/CreateLicenseAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class CreateLicenseAction
{
public function execute(PurchaseAssignment $assignment, Carbon $expiresAt = null): License
public function execute(PurchaseAssignment $assignment, ?Carbon $expiresAt = null): License
{
return License::create([
'key' => Str::random(64),
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function show(Request $request, Product $product)
return view('front.pages.products.show', compact('product', 'assignments', 'licenses'));
}

public function buy(Request $request, Product $product, Purchasable $purchasable, License $license = null)
public function buy(Request $request, Product $product, Purchasable $purchasable, ?License $license = null)
{
if (! $purchasable->released) {
if (! current_user()?->hasAccessToUnReleasedProducts()) {
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/WwsdController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class WwsdController
{
public function __invoke(string $slug = null)
public function __invoke(?string $slug = null)
{
$mainVideo = $this->getMainVideo($slug);

Expand All @@ -22,7 +22,7 @@ public function __invoke(string $slug = null)
]);
}

protected function getMainVideo(string $slug = null): ?array
protected function getMainVideo(?string $slug = null): ?array
{
if (! $slug) {
return $this->videos()->where('main', true)->first();
Expand Down
4 changes: 2 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function resolveUuid(): string
return $this->uuid;
}

public function getPassthrough(License $license = null)
public function getPassthrough(?License $license = null)
{
$passthrough = [
'emails' => [$this->email],
Expand All @@ -90,7 +90,7 @@ public function getPassthrough(License $license = null)
return $passthrough;
}

public function getPayLinkForProductId(string $paddleProductId, License $license = null)
public function getPayLinkForProductId(string $paddleProductId, ?License $license = null)
{
$purchasable = Purchasable::findForPaddleProductId($paddleProductId);

Expand Down
4 changes: 2 additions & 2 deletions app/Services/Mailcoach/MailcoachApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class MailcoachApi
{
public function getSubscriber(string $email, string $listUuid = null): ?Subscriber
public function getSubscriber(string $email, ?string $listUuid = null): ?Subscriber
{
$listUuid ??= '4af46b59-3784-41a5-9272-6da31afa3a02';

Expand Down Expand Up @@ -37,7 +37,7 @@ public function getSubscriber(string $email, string $listUuid = null): ?Subscrib
return Subscriber::fromResponse($subscribers[0]);
}

public function subscribe(string $email, string $listUuid = null, bool $skipConfirmation = false, bool $skipWelcomeMail = false): ?Subscriber
public function subscribe(string $email, ?string $listUuid = null, bool $skipConfirmation = false, bool $skipWelcomeMail = false): ?Subscriber
{
$listUuid ??= '4af46b59-3784-41a5-9272-6da31afa3a02';

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"deploy": "envoy run deploy",
"deploy-code": "envoy run deploy-code",
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"analyse": "vendor/bin/phpstan analyse",
"analyse": "vendor/bin/phpstan analyse --memory-limit=2G",
"baseline": "vendor/bin/phpstan analyse --generate-baseline",
"ide-helper": [
"@php artisan ide-helper:eloquent",
Expand Down

0 comments on commit 4e8ddea

Please sign in to comment.