Test Setup Failed
Push — master ( d6fde7...1e848b )
by Php Easy Api
04:20
created

Options::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Migratio\GrammarStructure\Mysql\Wizard\Foreign;
4
5
use Migratio\Contract\Foreign\OptionsContract;
6
7
class Options implements OptionsContract
8
{
9
    /**
10
     * @var $wizard WizardContract
0 ignored issues
show
Documentation Bug introduced by
The doc comment $wizard at position 0 could not be parsed: Unknown type name '$wizard' at position 0 in $wizard.
Loading history...
11
     */
12
    protected $wizard;
13
14
    /**
15
     * @var $constraint
0 ignored issues
show
Documentation Bug introduced by
The doc comment $constraint at position 0 could not be parsed: Unknown type name '$constraint' at position 0 in $constraint.
Loading history...
16
     */
17
    protected $constraint;
18
19
    /**
20
     * Options constructor.
21
     * @param $wizard
22
     * @param $constraint
23
     */
24
    public function __construct($wizard,$constraint)
25
    {
26
        $this->wizard=$wizard;
27
        $this->constraint=$constraint;
28
    }
29
30
    /**
31
     * @return \Migratio\Contract\Foreign\OptionsPropertiesContract
32
     */
33
    public function onDelete()
34
    {
35
        $this->wizard->setReferences($this->constraint,'on','ON DELETE');
36
        return new OptionsProperties($this->wizard,$this->constraint);
37
    }
38
39
    /**
40
     * @return \Migratio\Contract\Foreign\OptionsPropertiesContract
41
     */
42
    public function onUpdate()
43
    {
44
        $this->wizard->setReferences($this->constraint,'on','ON UPDATE');
45
        return new OptionsProperties($this->wizard,$this->constraint);
46
    }
47
48
}