Passed
Push — main ( 4834b9...990a94 )
by Usama
03:51
created

CommentifyPlugin::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
namespace Usamamuneerchaudhary\Commentify\Filament;
4
5
use Filament\Contracts\Plugin;
0 ignored issues
show
Bug introduced by
The type Filament\Contracts\Plugin 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...
6
use Filament\Panel;
0 ignored issues
show
Bug introduced by
The type Filament\Panel 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...
7
use Usamamuneerchaudhary\Commentify\Filament\Pages\CommentifySettings;
8
use Usamamuneerchaudhary\Commentify\Filament\Resources\CommentReportResource;
9
use Usamamuneerchaudhary\Commentify\Filament\Resources\CommentResource;
10
11
class CommentifyPlugin implements Plugin
12
{
13
    public function getId(): string
14
    {
15
        return 'commentify';
16
    }
17
18
    public function register(Panel $panel): void
19
    {
20
        $panel
21
            ->resources([
22
                CommentResource::class,
23
                CommentReportResource::class,
24
            ])
25
            ->pages([
26
                CommentifySettings::class,
27
            ]);
28
    }
29
30
    public function boot(Panel $panel): void
31
    {
32
        //
33
    }
34
35
    public static function make(): static
36
    {
37
        return app(static::class);
38
    }
39
40
    public static function get(): static
41
    {
42
        return filament(app(static::class)->getId());
0 ignored issues
show
Bug introduced by
The function filament was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

42
        return /** @scrutinizer ignore-call */ filament(app(static::class)->getId());
Loading history...
43
    }
44
}
45
46