Cat::getThrowable()   A
last analyzed

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\MagicActiveRecord;
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;
31
    }
32
33
    public function setNonExistingProperty(string $value): void
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
    public function setNonExistingProperty(/** @scrutinizer ignore-unused */ string $value): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
    {
35
    }
36
}
37