Completed
Push — master ( a35b70...1dd31e )
by Tim
13:48
created
Classes/Rendering/Menu.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 	/**
20 20
 	 * Render the given element
21 21
 	 *
22
-	 * @return array
22
+	 * @return string
23 23
 	 */
24 24
 	public function renderInternal() {
25 25
 		$str = $this->contentObject->cObjGetSingle($this->configuration['menu'], $this->configuration['menu.']);
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -16,52 +16,52 @@
 block discarded – undo
16 16
  */
17 17
 class Menu extends AbstractRendering {
18 18
 
19
-	/**
20
-	 * Render the given element
21
-	 *
22
-	 * @return array
23
-	 */
24
-	public function renderInternal() {
25
-		$str = $this->contentObject->cObjGetSingle($this->configuration['menu'], $this->configuration['menu.']);
26
-		$str = $this->breakBulletList($this->contentObject, trim(strip_tags(preg_replace('/<br\s*\/?>/i', chr(10), $this->parseBody($str)))));
27
-		return $str;
28
-	}
19
+    /**
20
+     * Render the given element
21
+     *
22
+     * @return array
23
+     */
24
+    public function renderInternal() {
25
+        $str = $this->contentObject->cObjGetSingle($this->configuration['menu'], $this->configuration['menu.']);
26
+        $str = $this->breakBulletList($this->contentObject, trim(strip_tags(preg_replace('/<br\s*\/?>/i', chr(10), $this->parseBody($str)))));
27
+        return $str;
28
+    }
29 29
 
30
-	/**
31
-	 * Breaks content lines into a bullet list
32
-	 *
33
-	 * @param ContentObjectRenderer $contentObject
34
-	 * @param string                $str Content string to make into a bullet list
35
-	 *
36
-	 * @return string Processed value
37
-	 */
38
-	function breakBulletList($contentObject, $str) {
39
-		$type = $contentObject->data['layout'];
40
-		$type = MathUtility::forceIntegerInRange($type, 0, 3);
30
+    /**
31
+     * Breaks content lines into a bullet list
32
+     *
33
+     * @param ContentObjectRenderer $contentObject
34
+     * @param string                $str Content string to make into a bullet list
35
+     *
36
+     * @return string Processed value
37
+     */
38
+    function breakBulletList($contentObject, $str) {
39
+        $type = $contentObject->data['layout'];
40
+        $type = MathUtility::forceIntegerInRange($type, 0, 3);
41 41
 
42
-		$tConf = $this->configuration['bulletlist.'][$type . '.'];
42
+        $tConf = $this->configuration['bulletlist.'][$type . '.'];
43 43
 
44
-		$cParts = explode(chr(10), $str);
45
-		$lines = array();
46
-		$c = 0;
44
+        $cParts = explode(chr(10), $str);
45
+        $lines = array();
46
+        $c = 0;
47 47
 
48
-		foreach ($cParts as $substrs) {
49
-			if (!strlen($substrs)) {
50
-				continue;
51
-			}
52
-			$c++;
53
-			$bullet = $tConf['bullet'] ? $tConf['bullet'] : ' - ';
54
-			$bLen = strlen($bullet);
55
-			$bullet = substr(str_replace('#', $c, $bullet), 0, $bLen);
56
-			$secondRow = substr($tConf['secondRow'] ? $tConf['secondRow'] : str_pad('', strlen($bullet), ' '), 0, $bLen);
48
+        foreach ($cParts as $substrs) {
49
+            if (!strlen($substrs)) {
50
+                continue;
51
+            }
52
+            $c++;
53
+            $bullet = $tConf['bullet'] ? $tConf['bullet'] : ' - ';
54
+            $bLen = strlen($bullet);
55
+            $bullet = substr(str_replace('#', $c, $bullet), 0, $bLen);
56
+            $secondRow = substr($tConf['secondRow'] ? $tConf['secondRow'] : str_pad('', strlen($bullet), ' '), 0, $bLen);
57 57
 
58
-			$lines[] = $bullet . $this->breakLines($substrs, chr(10) . $secondRow, Configuration::getPlainTextWith() - $bLen);
58
+            $lines[] = $bullet . $this->breakLines($substrs, chr(10) . $secondRow, Configuration::getPlainTextWith() - $bLen);
59 59
 
60
-			$blanks = MathUtility::forceIntegerInRange($tConf['blanks'], 0, 1000);
61
-			if ($blanks) {
62
-				$lines[] = str_pad('', $blanks - 1, chr(10));
63
-			}
64
-		}
65
-		return implode(chr(10), $lines);
66
-	}
60
+            $blanks = MathUtility::forceIntegerInRange($tConf['blanks'], 0, 1000);
61
+            if ($blanks) {
62
+                $lines[] = str_pad('', $blanks - 1, chr(10));
63
+            }
64
+        }
65
+        return implode(chr(10), $lines);
66
+    }
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		$type = $contentObject->data['layout'];
40 40
 		$type = MathUtility::forceIntegerInRange($type, 0, 3);
41 41
 
42
-		$tConf = $this->configuration['bulletlist.'][$type . '.'];
42
+		$tConf = $this->configuration['bulletlist.'][$type.'.'];
43 43
 
44 44
 		$cParts = explode(chr(10), $str);
45 45
 		$lines = array();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			$bullet = substr(str_replace('#', $c, $bullet), 0, $bLen);
56 56
 			$secondRow = substr($tConf['secondRow'] ? $tConf['secondRow'] : str_pad('', strlen($bullet), ' '), 0, $bLen);
57 57
 
58
-			$lines[] = $bullet . $this->breakLines($substrs, chr(10) . $secondRow, Configuration::getPlainTextWith() - $bLen);
58
+			$lines[] = $bullet.$this->breakLines($substrs, chr(10).$secondRow, Configuration::getPlainTextWith() - $bLen);
59 59
 
60 60
 			$blanks = MathUtility::forceIntegerInRange($tConf['blanks'], 0, 1000);
61 61
 			if ($blanks) {
Please login to merge, or discard this patch.
Classes/Rendering/Text.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 	/**
16 16
 	 * Render the current content
17 17
 	 *
18
-	 * @return array
18
+	 * @return string[]
19 19
 	 */
20 20
 	public function renderInternal() {
21 21
 
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
  */
13 13
 class Text extends AbstractRendering {
14 14
 
15
-	/**
16
-	 * Render the current content
17
-	 *
18
-	 * @return array
19
-	 */
20
-	public function renderInternal() {
15
+    /**
16
+     * Render the current content
17
+     *
18
+     * @return array
19
+     */
20
+    public function renderInternal() {
21 21
 
22
-		$lines[] = trim($this->breakContent(strip_tags($this->parseBody($this->contentObject->data['bodytext']))), CRLF . TAB);
23
-		return $lines;
22
+        $lines[] = trim($this->breakContent(strip_tags($this->parseBody($this->contentObject->data['bodytext']))), CRLF . TAB);
23
+        return $lines;
24 24
 
25
-	}
25
+    }
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 	 */
20 20
 	public function renderInternal() {
21 21
 
22
-		$lines[] = trim($this->breakContent(strip_tags($this->parseBody($this->contentObject->data['bodytext']))), CRLF . TAB);
22
+		$lines[] = trim($this->breakContent(strip_tags($this->parseBody($this->contentObject->data['bodytext']))), CRLF.TAB);
23 23
 		return $lines;
24 24
 
25 25
 	}
Please login to merge, or discard this patch.
Classes/Configuration.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -12,31 +12,31 @@
 block discarded – undo
12 12
  */
13 13
 class Configuration {
14 14
 
15
-	/**
16
-	 * get the plaintext width
17
-	 *
18
-	 * @return int
19
-	 */
20
-	static public function getPlainTextWith() {
21
-		return isset($GLOBALS['TSFE']->config['config']['plainTextWith']) ? (int)$GLOBALS['TSFE']->config['config']['plainTextWith'] : 76;
22
-	}
15
+    /**
16
+     * get the plaintext width
17
+     *
18
+     * @return int
19
+     */
20
+    static public function getPlainTextWith() {
21
+        return isset($GLOBALS['TSFE']->config['config']['plainTextWith']) ? (int)$GLOBALS['TSFE']->config['config']['plainTextWith'] : 76;
22
+    }
23 23
 
24
-	/**
25
-	 * get the table mode
26
-	 *
27
-	 * @return string
28
-	 */
29
-	static public function getTableMode() {
30
-		return isset($GLOBALS['TSFE']->config['config']['tableMode']) && trim($GLOBALS['TSFE']->config['config']['tableMode']) !== '' ? trim($GLOBALS['TSFE']->config['config']['tableMode']) : 'default';
31
-	}
24
+    /**
25
+     * get the table mode
26
+     *
27
+     * @return string
28
+     */
29
+    static public function getTableMode() {
30
+        return isset($GLOBALS['TSFE']->config['config']['tableMode']) && trim($GLOBALS['TSFE']->config['config']['tableMode']) !== '' ? trim($GLOBALS['TSFE']->config['config']['tableMode']) : 'default';
31
+    }
32 32
 
33
-	/**
34
-	 * check if the plain tables are 100 displayed
35
-	 *
36
-	 * @return string
37
-	 */
38
-	static public function isPlainTable100() {
39
-		return isset($GLOBALS['TSFE']->config['config']['plainTable100']) && trim($GLOBALS['TSFE']->config['config']['plainTable100']) !== '' ? (bool)$GLOBALS['TSFE']->config['config']['plainTable100'] : TRUE;
40
-	}
33
+    /**
34
+     * check if the plain tables are 100 displayed
35
+     *
36
+     * @return string
37
+     */
38
+    static public function isPlainTable100() {
39
+        return isset($GLOBALS['TSFE']->config['config']['plainTable100']) && trim($GLOBALS['TSFE']->config['config']['plainTable100']) !== '' ? (bool)$GLOBALS['TSFE']->config['config']['plainTable100'] : TRUE;
40
+    }
41 41
 
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this 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
 	 * @return int
19 19
 	 */
20 20
 	static public function getPlainTextWith() {
21
-		return isset($GLOBALS['TSFE']->config['config']['plainTextWith']) ? (int)$GLOBALS['TSFE']->config['config']['plainTextWith'] : 76;
21
+		return isset($GLOBALS['TSFE']->config['config']['plainTextWith']) ? (int) $GLOBALS['TSFE']->config['config']['plainTextWith'] : 76;
22 22
 	}
23 23
 
24 24
 	/**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 * @return string
37 37
 	 */
38 38
 	static public function isPlainTable100() {
39
-		return isset($GLOBALS['TSFE']->config['config']['plainTable100']) && trim($GLOBALS['TSFE']->config['config']['plainTable100']) !== '' ? (bool)$GLOBALS['TSFE']->config['config']['plainTable100'] : TRUE;
39
+		return isset($GLOBALS['TSFE']->config['config']['plainTable100']) && trim($GLOBALS['TSFE']->config['config']['plainTable100']) !== '' ? (bool) $GLOBALS['TSFE']->config['config']['plainTable100'] : TRUE;
40 40
 	}
41 41
 
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Classes/Postprocessing/RemoveJavaScript.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
  */
13 13
 class RemoveJavaScript implements PostprocessingInterface {
14 14
 
15
-	/**
16
-	 * Run the replacement
17
-	 *
18
-	 * @param string $content
19
-	 *
20
-	 * @return string
21
-	 * @todo remove also onchange etc.
22
-	 */
23
-	public function process($content) {
24
-		return preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
25
-	}
15
+    /**
16
+     * Run the replacement
17
+     *
18
+     * @param string $content
19
+     *
20
+     * @return string
21
+     * @todo remove also onchange etc.
22
+     */
23
+    public function process($content) {
24
+        return preg_replace('#<script(.*?)>(.*?)</script>#is', '', $content);
25
+    }
26 26
 }
Please login to merge, or discard this patch.
Classes/Postprocessing/RemoveGenerator.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
  */
13 13
 class RemoveGenerator implements PostprocessingInterface {
14 14
 
15
-	/**
16
-	 * Remove the generator tag
17
-	 *
18
-	 * @param string $content
19
-	 *
20
-	 * @return string
21
-	 */
22
-	public function process($content) {
23
-		return preg_replace('/<meta name="?generator"?.+?>/is', '', $content);
24
-	}
15
+    /**
16
+     * Remove the generator tag
17
+     *
18
+     * @param string $content
19
+     *
20
+     * @return string
21
+     */
22
+    public function process($content) {
23
+        return preg_replace('/<meta name="?generator"?.+?>/is', '', $content);
24
+    }
25 25
 }
Please login to merge, or discard this patch.
Classes/Postprocessing/RemoveHtmlComments.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
  */
13 13
 class RemoveHtmlComments implements PostprocessingInterface {
14 14
 
15
-	/**
16
-	 * Run the replacement of the comments
17
-	 *
18
-	 * @param string $content
19
-	 *
20
-	 * @return string
21
-	 */
22
-	public function process($content) {
23
-		return preg_replace('/<!--(.*?)-->/s', '', $content);
24
-	}
15
+    /**
16
+     * Run the replacement of the comments
17
+     *
18
+     * @param string $content
19
+     *
20
+     * @return string
21
+     */
22
+    public function process($content) {
23
+        return preg_replace('/<!--(.*?)-->/s', '', $content);
24
+    }
25 25
 }
Please login to merge, or discard this patch.
Classes/Postprocessing/RemoveMultipleEmptyLines.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
  */
13 13
 class RemoveMultipleEmptyLines implements PostprocessingInterface {
14 14
 
15
-	/**
16
-	 * Run the cleanup of the empty lines
17
-	 *
18
-	 * @param string $content
19
-	 *
20
-	 * @return string
21
-	 */
22
-	public function process($content) {
23
-		return preg_replace('/\n{4,}/', "\n\n\n", $content);
24
-	}
15
+    /**
16
+     * Run the cleanup of the empty lines
17
+     *
18
+     * @param string $content
19
+     *
20
+     * @return string
21
+     */
22
+    public function process($content) {
23
+        return preg_replace('/\n{4,}/', "\n\n\n", $content);
24
+    }
25 25
 }
Please login to merge, or discard this patch.
Classes/Postprocessing/InlineCss.php 3 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -18,49 +18,49 @@
 block discarded – undo
18 18
  */
19 19
 class InlineCss implements PostprocessingInterface {
20 20
 
21
-	/**
22
-	 * Call the inliner CSS processor
23
-	 *
24
-	 * @param string $content
25
-	 *
26
-	 * @return string
27
-	 */
28
-	public function process($content) {
29
-		GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('ink', 'Resources/Private/Php/vendor/autoload.php'));
30
-		$pattern = '%<(link|style)(?=[^<>]*?(?:type="(text/css)"|>))(?=[^<>]*?(?:media="([^<>"]*)"|>))(?=[^<>]*?(?:href="(.*?)"|>))(?=[^<>]*(?:rel="([^<>"]*)"|>))(?:.*?</\1>|[^<>]*>)%si';
31
-		$matches = array();
32
-		$css = '';
33
-		preg_match_all($pattern, $content, $matches);
34
-		if (isset($matches[0])) {
35
-			foreach ($matches[0] as $key => $match) {
36
-				if ($matches[1][$key] === 'style') {
37
-					$css .= strip_tags($match);
38
-				} elseif (strpos($match, 'type="text/css"') !== FALSE) {
21
+    /**
22
+     * Call the inliner CSS processor
23
+     *
24
+     * @param string $content
25
+     *
26
+     * @return string
27
+     */
28
+    public function process($content) {
29
+        GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('ink', 'Resources/Private/Php/vendor/autoload.php'));
30
+        $pattern = '%<(link|style)(?=[^<>]*?(?:type="(text/css)"|>))(?=[^<>]*?(?:media="([^<>"]*)"|>))(?=[^<>]*?(?:href="(.*?)"|>))(?=[^<>]*(?:rel="([^<>"]*)"|>))(?:.*?</\1>|[^<>]*>)%si';
31
+        $matches = array();
32
+        $css = '';
33
+        preg_match_all($pattern, $content, $matches);
34
+        if (isset($matches[0])) {
35
+            foreach ($matches[0] as $key => $match) {
36
+                if ($matches[1][$key] === 'style') {
37
+                    $css .= strip_tags($match);
38
+                } elseif (strpos($match, 'type="text/css"') !== FALSE) {
39 39
 
40
-					$file = preg_replace('/^(.+)\.(\d+)\.css$/', '$1.css', $matches[4][$key]);
41
-					$parts = parse_url($file);
42
-					if (isset($parts['query'])) {
43
-						unset($parts['query']);
44
-					}
45
-					if (!isset($parts['host'])) {
46
-						$parts['path'] = ltrim($parts['path'], '/');
47
-					}
40
+                    $file = preg_replace('/^(.+)\.(\d+)\.css$/', '$1.css', $matches[4][$key]);
41
+                    $parts = parse_url($file);
42
+                    if (isset($parts['query'])) {
43
+                        unset($parts['query']);
44
+                    }
45
+                    if (!isset($parts['host'])) {
46
+                        $parts['path'] = ltrim($parts['path'], '/');
47
+                    }
48 48
 
49
-					if($parts['host'] === GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')) {
50
-						unset($parts['scheme']);
51
-						unset($parts['host']);
52
-						$parts['path'] = ltrim($parts['path'], '/');
53
-					}
49
+                    if($parts['host'] === GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')) {
50
+                        unset($parts['scheme']);
51
+                        unset($parts['host']);
52
+                        $parts['path'] = ltrim($parts['path'], '/');
53
+                    }
54 54
 
55
-					$file = HttpUtility::buildUrl($parts);
56
-					$css .= GeneralUtility::getUrl($file);
57
-				} else {
58
-					continue;
59
-				}
60
-				$content = str_replace($match, '', $content);
61
-			}
62
-		}
63
-		$format = new CssToInlineStyles($content, $css);
64
-		return $format->convert();
65
-	}
55
+                    $file = HttpUtility::buildUrl($parts);
56
+                    $css .= GeneralUtility::getUrl($file);
57
+                } else {
58
+                    continue;
59
+                }
60
+                $content = str_replace($match, '', $content);
61
+            }
62
+        }
63
+        $format = new CssToInlineStyles($content, $css);
64
+        return $format->convert();
65
+    }
66 66
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 						$parts['path'] = ltrim($parts['path'], '/');
47 47
 					}
48 48
 
49
-					if($parts['host'] === GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')) {
49
+					if ($parts['host'] === GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY')) {
50 50
 						unset($parts['scheme']);
51 51
 						unset($parts['host']);
52 52
 						$parts['path'] = ltrim($parts['path'], '/');
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
12 12
 use TYPO3\CMS\Core\Utility\GeneralUtility;
13 13
 use TYPO3\CMS\Core\Utility\HttpUtility;
14
-use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
15 14
 
16 15
 /**
17 16
  * Inliner for CSS
Please login to merge, or discard this patch.
Classes/Postprocessing/PostprocessingInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
  */
12 12
 interface PostprocessingInterface {
13 13
 
14
-	/**
15
-	 * Run the process
16
-	 *
17
-	 * @param string $content
18
-	 *
19
-	 * @return string
20
-	 */
21
-	public function process($content);
14
+    /**
15
+     * Run the process
16
+     *
17
+     * @param string $content
18
+     *
19
+     * @return string
20
+     */
21
+    public function process($content);
22 22
 
23 23
 }
24 24
\ No newline at end of file
Please login to merge, or discard this patch.