Failed Conditions
Pull Request — master (#28)
by Dallas
05:15
created

CreateFunctionBuilder   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 7
eloc 26
c 1
b 0
f 1
dl 0
loc 32
ccs 0
cts 24
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B __call() 0 30 7
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Umbrellio\Postgres\Schema\Builders\Routines;
6
7
use Illuminate\Support\Fluent;
8
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\ExecutionBuilder;
9
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\FunctionArgumentBuilder;
10
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\FunctionSecurityBuilder;
11
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\FunctionSetBuilder;
12
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\ParallelBuilder;
13
use Umbrellio\Postgres\Schema\Builders\Routines\Functions\StabilityBuilder;
14
15
class CreateFunctionBuilder extends Fluent
16
{
17
    public function __call($method, $parameters)
18
    {
19
        switch ($method) {
20
            case 'arg':
21
                $command = new FunctionArgumentBuilder($this);
22
                $this->attributes[$method] = call_user_func_array([$command, $method], $parameters);
23
                break;
24
            case 'stability':
25
                $command = new StabilityBuilder($this);
26
                $this->attributes[$method] = call_user_func_array([$command, $method], $parameters);
27
                break;
28
            case 'execution':
29
                $command = new ExecutionBuilder($this);
30
                break;
31
            case 'security':
32
                $command = new FunctionSecurityBuilder($this);
33
                break;
34
            case 'set':
35
                $command = new FunctionSetBuilder($this);
36
                break;
37
            case 'parallel':
38
                $command = new ParallelBuilder($this);
39
                break;
40
            default:
41
                $command = $this;
42
        }
43
44
        parent::__call($method, $parameters);
45
46
        return $command ?? $this;
47
    }
48
}
49