Failed Conditions
Pull Request — develop (#3581)
by Jonathan
12:44
created

SchemaEventArgs::preventDefault()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Event;
6
7
use Doctrine\Common\EventArgs;
8
9
/**
10
 * Base class for schema related events.
11
 */
12
class SchemaEventArgs extends EventArgs
13
{
14
    /** @var bool */
15
    private $preventDefault = false;
16
17
    /**
18
     * @return $this
19
     */
20
    public function preventDefault() : self
21
    {
22
        $this->preventDefault = true;
23
24
        return $this;
25
    }
26
27 988
    public function isDefaultPrevented() : bool
28
    {
29 988
        return $this->preventDefault;
30
    }
31
}
32