Component   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 28
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A of() 0 3 1
A __construct() 0 2 1
1
<?php
2
3
namespace Cerbero\EloquentInspector\Components;
4
5
/**
6
 * The abstract model component.
7
 *
8
 */
9
abstract class Component
10
{
11
    /**
12
     * Instantiate the class.
13
     *
14
     * @param string $model
15
     */
16 4
    public function __construct(protected string $model)
17
    {
18 4
    }
19
20
    /**
21
     * Statically instantiate the class
22
     *
23
     * @param string $model
24
     * @return static
25
     */
26 3
    public static function of(string $model): static
27
    {
28 3
        return new static($model);
29
    }
30
31
    /**
32
     * Retrieve the inspected model component
33
     *
34
     * @return mixed
35
     */
36
    abstract public function get(): mixed;
37
}
38