Passed
Branch master (8f4937)
by smiley
04:23
created
src/Modules/Markdown/StyledText.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * Transforms several styled text tags into Markdown
19 19
  */
20
-class StyledText extends MarkdownBaseModule implements ModuleInterface{
20
+class StyledText extends MarkdownBaseModule implements ModuleInterface {
21 21
 
22 22
 	/**
23 23
 	 * An array of tags the module is able to process
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 	 * @see \chillerlan\bbcode\Modules\BaseModuleInterface::transform()
35 35
 	 * @internal
36 36
 	 */
37
-	public function __transform(){
38
-		if(empty($this->content)){
37
+	public function __transform() {
38
+		if (empty($this->content)) {
39 39
 			return '';
40 40
 		}
41 41
 
42 42
 		$str = [
43 43
 			'b'      => '**', // bold
44
-			'c'      => '`',  // inline code
44
+			'c'      => '`', // inline code
45 45
 			'del'    => '~~', // strikethrough
46
-			'i'      => '_',  // italic
46
+			'i'      => '_', // italic
47 47
 			's'      => '~~', // strikethrough
48 48
 			'strong' => '**', // bold
49 49
 		][$this->tag];
Please login to merge, or discard this patch.
src/Modules/Markup/MarkupBaseModule.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * The base module implements the basic functionality for each module (Markup: (X)HTML, XML, etc.)
20 20
  */
21
-class MarkupBaseModule extends BaseModule implements BaseModuleInterface{
21
+class MarkupBaseModule extends BaseModule implements BaseModuleInterface {
22 22
 
23 23
 	/**
24 24
 	 * Allowed text-align modes
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @return string
104 104
 	 */
105
-	public function sanitize($content){
105
+	public function sanitize($content) {
106 106
 		return htmlspecialchars($content, ENT_NOQUOTES, 'UTF-8', false);
107 107
 	}
108 108
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 *
114 114
 	 * @see https://xkcd.com/221/
115 115
 	 */
116
-	protected function randomID(){
116
+	protected function randomID() {
117 117
 		return hash('crc32b', mt_rand().microtime(true));
118 118
 	}
119 119
 
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return string usable as (X)HTML/XML class attribute
127 127
 	 */
128
-	protected function getCssClass(array $additional_classes = []){
128
+	protected function getCssClass(array $additional_classes = []) {
129 129
 		$classes = $this->getAttribute('class', '').' '.implode(' ', $additional_classes);
130
-		$classes =preg_replace('/[^a-z\d\- ]/i', '', $classes);
130
+		$classes = preg_replace('/[^a-z\d\- ]/i', '', $classes);
131 131
 		$classes = trim($classes);
132 132
 
133 133
 		return !empty($classes) ? ' class="'.$classes.'"' : '';
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 *
142 142
 	 * @return string usable as (X)HTML/XML title attribute
143 143
 	 */
144
-	protected function getTitle($title = ''){
144
+	protected function getTitle($title = '') {
145 145
 		$title = $this->getAttribute('title', $title);
146 146
 
147 147
 		// @todo: filter
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 	 *
157 157
 	 * @return string usable as (X)HTML/XML style attribute
158 158
 	 */
159
-	protected function getStyle(array $style = []){
159
+	protected function getStyle(array $style = []) {
160 160
 		$out = [];
161 161
 
162
-		foreach($style as $property => $value){
162
+		foreach ($style as $property => $value) {
163 163
 			// @todo: if(in_array($property, $allowed))?
164 164
 			// handle exclusions of common user definable properties
165
-			switch(true){
165
+			switch (true) {
166 166
 				// color
167 167
 				case in_array($property, ['background-color', 'color'])
168 168
 					&& !preg_match('/^#([a-f\d]{3}){1,2}$/i', $value):
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 					break;
175 175
 			}
176 176
 
177
-			if($value){
177
+			if ($value) {
178 178
 				$out[] = $property.':'.$value;
179 179
 			}
180 180
 		}
Please login to merge, or discard this patch.
src/Modules/Mediawiki/MediawikiBaseModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * The base module implements the basic functionality for each module (Mediawiki)
20 20
  */
21
-class MediawikiBaseModule extends BaseModule implements BaseModuleInterface{
21
+class MediawikiBaseModule extends BaseModule implements BaseModuleInterface {
22 22
 
23 23
 	/**
24 24
 	 * Holds an array of FQN strings to the current base module's children
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string
39 39
 	 */
40
-	public function sanitize($content){
40
+	public function sanitize($content) {
41 41
 		// TODO: Implement sanitize() method.
42 42
 		return $content;
43 43
 	}
Please login to merge, or discard this patch.
src/Modules/ModuleInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 /**
18 18
  * Implements the module specific functionality
19 19
  */
20
-interface ModuleInterface{
20
+interface ModuleInterface {
21 21
 
22 22
 	/**
23 23
 	 * Transforms the bbcode, called from BaseModuleInterface
Please login to merge, or discard this patch.
src/Modules/Tagmap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  *
18 18
  * @see \chillerlan\bbcode\Modules\BaseModuleInterface::getTags()
19 19
  */
20
-class Tagmap{
20
+class Tagmap {
21 21
 
22 22
 	/**
23 23
 	 * An array of tags a module is able to process
Please login to merge, or discard this patch.
src/Modules/Text/TextBaseModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * The base module implements the basic functionality for each module (plain text)
20 20
  */
21
-class TextBaseModule extends BaseModule implements BaseModuleInterface{
21
+class TextBaseModule extends BaseModule implements BaseModuleInterface {
22 22
 
23 23
 	/**
24 24
 	 * Holds an array of FQN strings to the current base module's children
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string
39 39
 	 */
40
-	public function sanitize($content){
40
+	public function sanitize($content) {
41 41
 		// TODO: Implement sanitize() method.
42 42
 		return 'Implement sanitize() method!';
43 43
 	}
Please login to merge, or discard this patch.
src/ParserExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 /**
16 16
  * An empty parser extension as ground to start from
17 17
  */
18
-class ParserExtension implements ParserExtensionInterface{
18
+class ParserExtension implements ParserExtensionInterface {
19 19
 
20 20
 	/**
21 21
 	 * @var \chillerlan\bbcode\ParserOptions
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \chillerlan\bbcode\ParserOptions $options
29 29
 	 */
30
-	public function __construct(ParserOptions $options){
30
+	public function __construct(ParserOptions $options) {
31 31
 		$this->options = $options;
32 32
 	}
33 33
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return string preparsed bbcode
43 43
 	 */
44
-	public function pre($bbcode){
44
+	public function pre($bbcode) {
45 45
 		return $bbcode;
46 46
 	}
47 47
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @return string postparsed bbcode
64 64
 	 */
65
-	public function post($bbcode){
65
+	public function post($bbcode) {
66 66
 		return $bbcode;
67 67
 	}
68 68
 
Please login to merge, or discard this patch.
src/ParserExtensionInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * Implements pre-/post-parser methods, for example: parsing Smileys
17 17
  */
18
-interface ParserExtensionInterface{
18
+interface ParserExtensionInterface {
19 19
 
20 20
 	/**
21 21
 	 * Pre-parser
Please login to merge, or discard this patch.
src/ParserOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  *
21 21
  * @see \chillerlan\bbcode\Parser::__construct()
22 22
  */
23
-class ParserOptions{
23
+class ParserOptions {
24 24
 
25 25
 	/**
26 26
 	 * The language class to use (FQN)
Please login to merge, or discard this patch.