SegmentFieldTestModifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 26
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSuggestion() 0 4 1
A getPreview() 0 4 1
1
<?php
2
3
namespace SilverStripe\Forms\Tests;
4
5
use SilverStripe\Forms\SegmentFieldModifier\AbstractSegmentFieldModifier;
6
7
class SegmentFieldTestModifier extends AbstractSegmentFieldModifier
8
{
9
    /**
10
     * @inheritdoc
11
     *
12
     * @param string $value
13
     *
14
     * @return string
15
     */
16
    public function getSuggestion($value)
17
    {
18
        return strtoupper($value);
19
    }
20
21
    /**
22
     * @inheritdoc
23
     *
24
     * @param string $value
25
     *
26
     * @return string
27
     */
28
    public function getPreview($value)
29
    {
30
        return strtolower($value);
31
    }
32
}
33