Completed
Push — master ( 8c66d9...9360f0 )
by Hannes
03:21 queued 02:00
created

ClearingSeparatorRewriter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A rewrite() 0 9 1
1
<?php
2
3
namespace byrokrat\banking\Rewriter;
4
5
/**
6
 * Replace and unvalid clearing-serial separating dash with a comma
7
 *
8
 * @codeCoverageIgnore
9
 * @deprecated
10
 */
11
class ClearingSeparatorRewriter implements RewriterStrategy
12
{
13
    public function __construct()
14
    {
15
        trigger_error("ClearingSeparatorRewriter is deprecated and will be removed", E_USER_DEPRECATED);
16
    }
17
18
    public function rewrite($number)
19
    {
20
        return preg_replace(
21
            '/-/',
22
            ',',
23
            $number,
24
            1
25
        );
26
    }
27
}
28