Passed
Pull Request — master (#15)
by Sebastian
04:12
created

_process()   A

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * @package Mailcode
4
 * @subpackage Parser
5
 * @see \Mailcode\Mailcode_Parser_Statement_Tokenizer_Process_LegacySyntaxConversion
6
 */
7
8
declare(strict_types=1);
9
10
namespace Mailcode;
11
12
/**
13
 * Converts older, deprecated mailcode command syntax to
14
 * the current format to stay backwards compatible.
15
 *
16
 * @package Mailcode
17
 * @subpackage Parser
18
 * @author Sebastian Mordziol <[email protected]>
19
 */
20
class Mailcode_Parser_Statement_Tokenizer_Process_LegacySyntaxConversion extends Mailcode_Parser_Statement_Tokenizer_Process
21
{
22
    private array $conversions = array(
23
        'timezone:' => 'timezone=',
24
        'break-at:' => 'break-at=',
25
        'count:' => 'count='
26
    );
27
28
    protected function _process() : void
29
    {
30
        $this->tokenized = str_replace(array_keys($this->conversions), array_values($this->conversions), $this->tokenized);
31
    }
32
}
33