CommentifyPlugin::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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
        // Check if Filament is installed
21
        if (!class_exists(\Filament\Filament::class)) {
0 ignored issues
show
Bug introduced by
The type Filament\Filament 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...
22
            return;
23
        }
24
25
        $panel
26
            ->resources([
27
                CommentResource::class,
28
                CommentReportResource::class,
29
            ])
30
            ->pages([
31
                CommentifySettings::class,
32
            ]);
33
    }
34
35
    public function boot(Panel $panel): void
36
    {
37
        //
38
    }
39
40
    public static function make(): static
41
    {
42
        return app(static::class);
43
    }
44
45
    public static function get(): static
46
    {
47
        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

47
        return /** @scrutinizer ignore-call */ filament(app(static::class)->getId());
Loading history...
48
    }
49
}
50
51