Completed
Push — master ( 234667...5ddeab )
by Tim
20s queued 13s
created
Classes/Middleware/SvgStoreMiddleware.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@
 block discarded – undo
18 18
  */
19 19
 class SvgStoreMiddleware implements MiddlewareInterface
20 20
 {
21
-    /**
22
-     * Search/Extract/Merge SVGs @ HTML output.
23
-     */
24
-    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
25
-    {
26
-        $response = $handler->handle($request);
21
+	/**
22
+	 * Search/Extract/Merge SVGs @ HTML output.
23
+	 */
24
+	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
25
+	{
26
+		$response = $handler->handle($request);
27 27
 
28
-        if (!($response instanceof NullResponse)
29
-        && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController
30
-        && ($GLOBALS['TSFE']->config['config']['svgstore.']['enabled'] ?? false)
31
-        && 'text/html' == substr($response->getHeaderLine('Content-Type'), 0, 9)
32
-        ) {
33
-            $processedHtml = GeneralUtility::makeInstance(\HTML\Sourceopt\Service\SvgStoreService::class)
34
-                ->process($response->getBody()->__toString())
35
-            ;
28
+		if (!($response instanceof NullResponse)
29
+		&& $GLOBALS['TSFE'] instanceof TypoScriptFrontendController
30
+		&& ($GLOBALS['TSFE']->config['config']['svgstore.']['enabled'] ?? false)
31
+		&& 'text/html' == substr($response->getHeaderLine('Content-Type'), 0, 9)
32
+		) {
33
+			$processedHtml = GeneralUtility::makeInstance(\HTML\Sourceopt\Service\SvgStoreService::class)
34
+				->process($response->getBody()->__toString())
35
+			;
36 36
 
37
-            $responseBody = new Stream('php://temp', 'rw');
38
-            $responseBody->write($processedHtml);
39
-            $response = $response->withBody($responseBody);
40
-        }
37
+			$responseBody = new Stream('php://temp', 'rw');
38
+			$responseBody->write($processedHtml);
39
+			$response = $response->withBody($responseBody);
40
+		}
41 41
 
42
-        return $response;
43
-    }
42
+		return $response;
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Classes/Middleware/CleanHtmlMiddleware.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -19,39 +19,39 @@
 block discarded – undo
19 19
  */
20 20
 class CleanHtmlMiddleware implements MiddlewareInterface
21 21
 {
22
-    /**
23
-     * @var CleanHtmlService
24
-     */
25
-    protected $cleanHtmlService;
26
-
27
-    public function __construct()
28
-    {
29
-        $this->cleanHtmlService = GeneralUtility::makeInstance(CleanHtmlService::class);
30
-    }
31
-
32
-    /**
33
-     * Clean the HTML output.
34
-     */
35
-    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
36
-    {
37
-        $response = $handler->handle($request);
38
-
39
-        if (!($response instanceof NullResponse)
40
-        && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController
41
-        && ($GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false)
42
-        && 'text/html' == substr($response->getHeaderLine('Content-Type'), 0, 9)
43
-        ) {
44
-            $processedHtml = $this->cleanHtmlService->clean(
45
-                $response->getBody()->__toString(),
46
-                $GLOBALS['TSFE']->config['config']['sourceopt.']
47
-            );
48
-
49
-            // Replace old body with $processedHtml
50
-            $responseBody = new Stream('php://temp', 'rw');
51
-            $responseBody->write($processedHtml);
52
-            $response = $response->withBody($responseBody);
53
-        }
54
-
55
-        return $response;
56
-    }
22
+	/**
23
+	 * @var CleanHtmlService
24
+	 */
25
+	protected $cleanHtmlService;
26
+
27
+	public function __construct()
28
+	{
29
+		$this->cleanHtmlService = GeneralUtility::makeInstance(CleanHtmlService::class);
30
+	}
31
+
32
+	/**
33
+	 * Clean the HTML output.
34
+	 */
35
+	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
36
+	{
37
+		$response = $handler->handle($request);
38
+
39
+		if (!($response instanceof NullResponse)
40
+		&& $GLOBALS['TSFE'] instanceof TypoScriptFrontendController
41
+		&& ($GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false)
42
+		&& 'text/html' == substr($response->getHeaderLine('Content-Type'), 0, 9)
43
+		) {
44
+			$processedHtml = $this->cleanHtmlService->clean(
45
+				$response->getBody()->__toString(),
46
+				$GLOBALS['TSFE']->config['config']['sourceopt.']
47
+			);
48
+
49
+			// Replace old body with $processedHtml
50
+			$responseBody = new Stream('php://temp', 'rw');
51
+			$responseBody->write($processedHtml);
52
+			$response = $response->withBody($responseBody);
53
+		}
54
+
55
+		return $response;
56
+	}
57 57
 }
Please login to merge, or discard this patch.