WelcomeUser::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Ikechukwukalu\Sanctumauthstarter\Notifications;
4
5
use Illuminate\Notifications\Messages\MailMessage;
6
use Ikechukwukalu\Sanctumauthstarter\Models\TestUser;
7
use App\Models\User;
0 ignored issues
show
Bug introduced by
The type App\Models\User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
class WelcomeUser extends UserNotification
10
{
11
    private TestUser|User $user;
12
13
    public function __construct(TestUser|User $user)
14
    {
15
        $this->user = $user;
16
    }
17
18
    public function toMail($notifiable)
19
    {
20
        return (new MailMessage)
21
                    ->subject(trans('sanctumauthstarter::notify.welcome.subject', ['name' => $this->user->name]))
22
                    ->line(trans('sanctumauthstarter::notify.welcome.introduction', ['name' => $this->user->name]))
23
                    ->line(trans('sanctumauthstarter::notify.welcome.message'))
24
                    ->action(trans('sanctumauthstarter::notify.welcome.action'), url(config('sanctumauthstarter.notification_url.registration.welcome_user')))
0 ignored issues
show
Bug introduced by
It seems like url(config('sanctumauths...tration.welcome_user')) can also be of type Illuminate\Contracts\Routing\UrlGenerator; however, parameter $url of Illuminate\Notifications...SimpleMessage::action() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
                    ->action(trans('sanctumauthstarter::notify.welcome.action'), /** @scrutinizer ignore-type */ url(config('sanctumauthstarter.notification_url.registration.welcome_user')))
Loading history...
25
                    ->line(trans('sanctumauthstarter::notify.welcome.complimentary_close'));
26
    }
27
}
28