@@ -27,19 +27,19 @@ discard block |
||
27 | 27 | { |
28 | 28 | const ERROR_INVALID_LOCATION_INSTANCE = 65601; |
29 | 29 | |
30 | - /** |
|
31 | - * @var Mailcode_Parser_Safeguard_Formatting |
|
32 | - */ |
|
30 | + /** |
|
31 | + * @var Mailcode_Parser_Safeguard_Formatting |
|
32 | + */ |
|
33 | 33 | protected $formatting; |
34 | 34 | |
35 | - /** |
|
36 | - * @var Mailcode_StringContainer |
|
37 | - */ |
|
35 | + /** |
|
36 | + * @var Mailcode_StringContainer |
|
37 | + */ |
|
38 | 38 | protected $subject; |
39 | 39 | |
40 | - /** |
|
41 | - * @var string[] |
|
42 | - */ |
|
40 | + /** |
|
41 | + * @var string[] |
|
42 | + */ |
|
43 | 43 | protected $log = array(); |
44 | 44 | |
45 | 45 | public function __construct(Mailcode_Parser_Safeguard_Formatting $formatting) |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | ); |
94 | 94 | } |
95 | 95 | |
96 | - /** |
|
97 | - * Retrieves all formatter-specific placeholder locations |
|
98 | - * in the subject string. |
|
99 | - * |
|
100 | - * @return Mailcode_Parser_Safeguard_Formatter_Location[] |
|
101 | - */ |
|
96 | + /** |
|
97 | + * Retrieves all formatter-specific placeholder locations |
|
98 | + * in the subject string. |
|
99 | + * |
|
100 | + * @return Mailcode_Parser_Safeguard_Formatter_Location[] |
|
101 | + */ |
|
102 | 102 | protected function resolveLocations() : array |
103 | 103 | { |
104 | 104 | $placeholders = $this->formatting->getSafeguard()->getPlaceholders(); |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | return $result; |
114 | 114 | } |
115 | 115 | |
116 | - /** |
|
117 | - * Resolves the newline character used in the string. |
|
118 | - * |
|
119 | - * @param string $subject |
|
120 | - * @return string |
|
121 | - */ |
|
116 | + /** |
|
117 | + * Resolves the newline character used in the string. |
|
118 | + * |
|
119 | + * @param string $subject |
|
120 | + * @return string |
|
121 | + */ |
|
122 | 122 | protected function resolveNewlineChar(string $subject) : string |
123 | 123 | { |
124 | 124 | $eol = ConvertHelper::detectEOLCharacter($subject); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | ); |
151 | 151 | } |
152 | 152 | |
153 | - /** |
|
154 | - * @return string[] |
|
155 | - */ |
|
153 | + /** |
|
154 | + * @return string[] |
|
155 | + */ |
|
156 | 156 | public function getLog() : array |
157 | 157 | { |
158 | 158 | return $this->log; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $instance = new $class($this, $placeholder); |
79 | 79 | |
80 | - if($instance instanceof Mailcode_Parser_Safeguard_Formatter_Location) |
|
80 | + if ($instance instanceof Mailcode_Parser_Safeguard_Formatter_Location) |
|
81 | 81 | { |
82 | 82 | return $instance; |
83 | 83 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | $result = array(); |
107 | 107 | |
108 | - foreach($placeholders as $placeholder) |
|
108 | + foreach ($placeholders as $placeholder) |
|
109 | 109 | { |
110 | 110 | $result[] = $this->createLocation($placeholder); |
111 | 111 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | $eol = ConvertHelper::detectEOLCharacter($subject); |
125 | 125 | |
126 | - if($eol) |
|
126 | + if ($eol) |
|
127 | 127 | { |
128 | 128 | $this->log(sprintf( |
129 | 129 | 'Detected EOL character: %s.', |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | */ |
24 | 24 | trait Mailcode_Traits_Formatting_HTMLHighlighting |
25 | 25 | { |
26 | - /** |
|
27 | - * @var string[] |
|
28 | - */ |
|
26 | + /** |
|
27 | + * @var string[] |
|
28 | + */ |
|
29 | 29 | private $excludeTags = array( |
30 | 30 | 'style', // NOTE: style tags are excluded natively on the parser level. |
31 | 31 | 'script' |
32 | 32 | ); |
33 | 33 | |
34 | - /** |
|
35 | - * Adds an HTML tag name to the list of tags within which |
|
36 | - * commands may not be highlighted. |
|
37 | - * |
|
38 | - * @param string $tagName Case insensitive. |
|
39 | - * @return $this |
|
40 | - */ |
|
34 | + /** |
|
35 | + * Adds an HTML tag name to the list of tags within which |
|
36 | + * commands may not be highlighted. |
|
37 | + * |
|
38 | + * @param string $tagName Case insensitive. |
|
39 | + * @return $this |
|
40 | + */ |
|
41 | 41 | public function excludeTag(string $tagName) |
42 | 42 | { |
43 | 43 | $tagName = strtolower($tagName); |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | return $this; |
51 | 51 | } |
52 | 52 | |
53 | - /** |
|
54 | - * Adds several exluded tag names at once. |
|
55 | - * |
|
56 | - * @param string[] $tagNames |
|
57 | - * @return $this |
|
58 | - */ |
|
53 | + /** |
|
54 | + * Adds several exluded tag names at once. |
|
55 | + * |
|
56 | + * @param string[] $tagNames |
|
57 | + * @return $this |
|
58 | + */ |
|
59 | 59 | public function excludeTags(array $tagNames) |
60 | 60 | { |
61 | 61 | foreach($tagNames as $tagName) |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | return $this; |
67 | 67 | } |
68 | 68 | |
69 | - /** |
|
70 | - * Whether the specified tag name is in the exlusion list. |
|
71 | - * |
|
72 | - * @param string $tagName |
|
73 | - * @return bool |
|
74 | - */ |
|
69 | + /** |
|
70 | + * Whether the specified tag name is in the exlusion list. |
|
71 | + * |
|
72 | + * @param string $tagName |
|
73 | + * @return bool |
|
74 | + */ |
|
75 | 75 | public function isTagExcluded(string $tagName) : bool |
76 | 76 | { |
77 | 77 | $tagName = strtolower($tagName); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $tagName = strtolower($tagName); |
44 | 44 | |
45 | - if(!in_array($tagName, $this->excludeTags)) |
|
45 | + if (!in_array($tagName, $this->excludeTags)) |
|
46 | 46 | { |
47 | 47 | $this->excludeTags[] = $tagName; |
48 | 48 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function excludeTags(array $tagNames) |
60 | 60 | { |
61 | - foreach($tagNames as $tagName) |
|
61 | + foreach ($tagNames as $tagName) |
|
62 | 62 | { |
63 | 63 | $this->excludeTag((string)$tagName); |
64 | 64 | } |