FormEntryManager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 9
c 0
b 0
f 0
dl 0
loc 29
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ignoreMigrations() 0 5 1
A routes() 0 8 1
1
<?php
2
3
namespace FormEntries;
4
5
use Illuminate\Support\Facades\Route;
6
7
class FormEntryManager
8
{
9
    /**
10
     * Indicates if laravel should run migrations for package.
11
     *
12
     * @var bool
13
     */
14
    public static bool $runsMigrations = true;
15
16
    /**
17
     * Configure laravel to not register current package migrations.
18
     *
19
     * @return static
20
     */
21 1
    public static function ignoreMigrations(): static
22
    {
23 1
        static::$runsMigrations = false;
24
25 1
        return new static;
26
    }
27
28 22
    public function routes(): static
29
    {
30 22
        Route::post(
31 22
            config('forms-entries.routing.path'),
32 22
            \FormEntries\Http\Controllers\SendFormEntryController::class
33 22
        )->name('forms-entries.submit');
34
35 22
        return $this;
36
    }
37
}
38