CommentifyPlugin   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 37
rs 10
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A register() 0 14 2
A boot() 0 2 1
A make() 0 3 1
A get() 0 3 1
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