Failed Conditions
Pull Request — master (#28)
by Dallas
06:04
created

FunctionArgumentBuilder::__call()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 10
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Umbrellio\Postgres\Schema\Builders\Routines\Functions;
6
7
use Illuminate\Support\Fluent;
8
use Umbrellio\Postgres\Schema\Builders\Routines\CreateFunctionBuilder;
9
10
class FunctionArgumentBuilder extends Fluent
11
{
12
    private $builder;
13
14
    public function __construct(CreateFunctionBuilder $builder, $attributes = [])
15
    {
16
        $this->builder = $builder;
17
18
        parent::__construct($attributes);
19
    }
20
21
    public function __call($method, $parameters)
22
    {
23
        if (in_array($method, ['in', 'out', 'inout', 'variadic'], true)) {
24
            $this->attributes['mode'] = $method;
25
        } else {
26
            parent::__call($method, $parameters);
27
        }
28
29
        return $this->builder;
30
    }
31
}
32