Completed
Push — master ( c6ec0f...bab290 )
by Magnar Ovedal
03:36
created

Capitalize   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stadly\PasswordPolice\WordConverter;
6
7
use Traversable;
8
9
final class Capitalize implements WordConverterInterface
10
{
11
    /**
12
     * {@inheritDoc}
13
     */
14 2
    public function convert(string $word): Traversable
15
    {
16 2
        yield mb_strtoupper(mb_substr($word, 0, 1)).mb_strtolower(mb_substr($word, 1));
17 2
    }
18
}
19