Passed
Pull Request — master (#17)
by Aleksei
03:38 queued 01:10
created

HasOne   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Annotated\Annotation\Relation;
13
14
use JetBrains\PhpStorm\ExpectedValues;
15
16
final class HasOne
17
{
18
    public function __construct(
19
        string $target,
20
        bool $cascade = true,
21
        bool $nullable = false,
22
        string $innerKey = null,
23
        string $outerKey = '{parentRole}_{innerKey}',
24
        bool $fkCreate = true,
25
        #[ExpectedValues(values: ['NO ACTION', 'CASCADE', 'SET NULL'])]
26
        string $fkAction = 'CASCADE',
27
        bool $indexCreate = true,
28
        #[ExpectedValues(values: ['lazy', 'eager'])]
29
        string $load = 'lazy',
30
        // Inverse $inverse = null, // can be uncommented for compatibility with php 8.1
31
    ) {
32
    }
33
}
34