NotificationResource   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 3
eloc 12
c 2
b 0
f 1
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A table() 0 3 1
A getPages() 0 5 1
A form() 0 3 1
1
<?php
2
3
namespace Usamamuneerchaudhary\Notifier\Filament\Resources;
4
5
use Filament\Resources\Resource;
6
use Filament\Tables\Table;
7
use Usamamuneerchaudhary\Notifier\Filament\Resources\NotificationResource\Pages\ListNotifications;
8
use Usamamuneerchaudhary\Notifier\Filament\Resources\NotificationResource\Pages\ViewNotification;
9
use Usamamuneerchaudhary\Notifier\Filament\Resources\NotificationResource\Schemas\NotificationForm;
10
use Usamamuneerchaudhary\Notifier\Filament\Resources\NotificationResource\Tables\NotificationTable;
11
use Usamamuneerchaudhary\Notifier\Models\Notification;
12
13
class NotificationResource extends Resource
14
{
15
    protected static ?string $model = Notification::class;
16
    protected static string|null|\BackedEnum $navigationIcon = 'heroicon-o-bell';
0 ignored issues
show
Bug introduced by
The type BackedEnum 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...
17
    protected static string|null|\UnitEnum $navigationGroup = 'Notifier';
0 ignored issues
show
Bug introduced by
The type UnitEnum 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...
18
    protected static ?string $modelLabel = 'Notification';
19
    protected static ?string $pluralModelLabel = 'Notifications';
20
    protected static ?int $navigationSort = 5;
21
22
    public static function form(\Filament\Schemas\Schema $schema): \Filament\Schemas\Schema
23
    {
24
        return NotificationForm::configure($schema);
25
    }
26
27
    public static function table(Table $table): Table
28
    {
29
        return NotificationTable::configure($table);
30
    }
31
32
    public static function getPages(): array
33
    {
34
        return [
35
            'index' => ListNotifications::route('/'),
36
            'view' => ViewNotification::route('/{record}'),
37
        ];
38
    }
39
}
40