Passed
Pull Request — master (#412)
by
unknown
17:58 queued 15:20
created

RuleWithCallsCount::afterInitAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Tests\Support\Rule;
6
7
use Attribute;
8
use RuntimeException;
9
use Yiisoft\Validator\AfterInitAttributeEventInterface;
10
use Yiisoft\Validator\RuleInterface;
11
12
#[Attribute(Attribute::TARGET_PROPERTY)]
13
final class RuleWithCallsCount implements RuleInterface, AfterInitAttributeEventInterface
14
{
15
    public static int $afterInitAttributeCallsCount = 0;
16
17
    public function afterInitAttribute(object $object): void
18
    {
19
        self::$afterInitAttributeCallsCount++;
20
    }
21
22
    public function getName(): string
23
    {
24
        return 'rule-with-calls-count';
25
    }
26
27
    public function getHandlerClassName(): string
28
    {
29
        throw new RuntimeException();
30
    }
31
}
32