Passed
Push — master ( 5e09ea...fc5aaf )
by Ondřej
03:46
created

PgObjectSignatureRefBase::fromQualifiedName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
namespace Ivory\Value;
4
5
/**
6
 * Reference to a PostgreSQL object by its signature.
7
 */
8
abstract class PgObjectSignatureRefBase extends PgObjectRefBase
9
{
10
    private $argTypes;
11
12
    public static function fromUnqualifiedName(string $name, PgTypeRef ...$argTypes)
13
    {
14
        $ref = new static(null, $name);
15
        $ref->argTypes = $argTypes;
16
        return $ref;
17
    }
18
19
    public static function fromQualifiedName(?string $schemaName, string $name, PgTypeRef ...$argTypes)
20
    {
21
        $ref = new static($schemaName, $name);
22
        $ref->argTypes = $argTypes;
23
        return $ref;
24
    }
25
26
    /**
27
     * @return PgTypeRef[] list of argument types
28
     */
29
    final public function getArgTypes(): array
30
    {
31
        return $this->argTypes;
32
    }
33
}
34