Completed
Push — trunk ( 062c60...ebaef8 )
by SuperNova.WS
11:27 queued 05:24
created

AllianceHelper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A formatText() 0 2 1
1
<?php
2
/**
3
 * Created by Gorlum 11.11.2018 4:57
4
 */
5
6
namespace Alliance;
7
8
class AllianceHelper {
9
  protected static $patterns = [
10
//    "#\[fc\]([a-z0-9\#]+)\[/fc\](.*?)\[/f\]#Ssi" => '<font color="\1">\2</font>',
11
    "#\[fc\]([a-z0-9\#]+)\[/fc\](.*?)\[/f\]#Ssi" => '<span style="color:\1">\2</span>',
12
    '#\[img\](.*?)\[/img\]#Smi'                  => '<img src="\1" alt="\1" style="border:0;" />',
13
//    "#\[fc\]([a-z0-9\#\ \[\]]+)\[/fc\]#Ssi"      => '<font color="\1">',
14
//    "#\[/f\]#Ssi"                                => '</font>',
15
    "#\[fc\]([a-z0-9\#\ \[\]]+)\[/fc\]#Ssi"      => '<span style="color:\1">',
16
    "#\[/f\]#Ssi"                                => '</span>',
17
  ];
18
19
  public static function formatText($text) {
20
    return nl2br(preg_replace(array_keys(self::$patterns), self::$patterns, $text));
21
  }
22
23
}
24