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

Cat   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getThrowable() 0 3 1
A getException() 0 3 1
A populateRecord() 0 5 1
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