Passed
Push — feature/6.x ( 53903f...32797a )
by Schlaefer
05:38 queued 02:15
created

BbcodePreparePreprocessor   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * Saito - The Threaded Web Forum
6
 *
7
 * @copyright Copyright (c) the Saito Project Developers
8
 * @link https://github.com/Schlaefer/Saito
9
 * @license http://opensource.org/licenses/MIT
10
 */
11
12
namespace BbcodeParser\Lib\Processors;
13
14
class BbcodePreparePreprocessor extends BbcodeProcessor
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function process($string)
20
    {
21
        $string = h($string);
22
        // Consolidates '\n\r', '\r' to `\n`
23
        $string = preg_replace('/\015\012|\015|\012/', "\n", $string);
24
25
        return $string;
26
    }
27
}
28