UpperCase::passes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Cube\SilverStripe\Validation\Tests\Stub;
4
5
use Cube\SilverStripe\Validation\Interfaces\Rule;
6
7
/**
8
 * Class UpperCase
9
 * @package Cube\SilverStripe\Validation\Tests\Stub
10
 */
11
class UpperCase implements Rule
12
{
13
    /**
14
     * @var string
15
     */
16
    public static $name = 'uppercase';
17
18
    /**
19
     * @param $value
20
     * @return bool
21
     */
22
    public function passes($value): bool
23
    {
24
        return strtoupper($value) === $value;
25
    }
26
}
27