CheckPupilGenderStep   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 17 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jtotty\Steps;
6
7
use Port\Steps\Step;
8
9
class CheckPupilGenderStep implements Step
10
{
11
    public function process($item, callable $next)
12
    {
13
        switch (strtoupper(substr($item['Gender'], 0, 1))) {
14
            case 'F':
15
                $item['Gender'] = 'F';
16
                break;
17
18
            case 'M':
19
                $item['Gender'] = 'M';
20
                break;
21
22
            default:
23
                $item['Gender'] = 'invalid';
24
                break;
25
        }
26
27
        return $next($item);
28
    }
29
}
30