Passed
Branch add-rector-actions (5668b1)
by Wilmer
03:26
created

Cat::getException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\ActiveRecord\Tests\Stubs\ActiveRecord;
6
7
use Yiisoft\Db\Exception\Exception;
8
9
final class Cat extends Animal
10
{
11
    public function populateRecord($row): void
12
    {
13
        parent::populateRecord($row);
14
15
        $this->setDoes('meow');
16
    }
17
18
    public function getException(): void
19
    {
20
        throw new Exception('no');
21
    }
22
23
    /**
24
     * This is to test if __isset catches the error.
25
     *
26
     * @throw DivisionByZeroError
27
     */
28
    public function getThrowable(): float|int
29
    {
30
        return 5/0;
0 ignored issues
show
Coding Style introduced by
Expected at least 1 space before "/"; 0 found
Loading history...
Coding Style introduced by
Expected at least 1 space after "/"; 0 found
Loading history...
31
    }
32
}
33