Completed
Push — master ( 5cc52f...d03d2a )
by Tim
12:25
created
Classes/Middleware/SvgStoreMiddleware.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@
 block discarded – undo
11 11
 
12 12
 class SvgStoreMiddleware extends AbstractMiddleware
13 13
 {
14
-    public function __construct(protected SvgStoreService $svgStoreService)
15
-    {
16
-    }
14
+	public function __construct(protected SvgStoreService $svgStoreService)
15
+	{
16
+	}
17 17
 
18
-    /**
19
-     * Search/Extract/Merge SVGs @ HTML output.
20
-     */
21
-    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
-    {
23
-        $response = $handler->handle($request);
18
+	/**
19
+	 * Search/Extract/Merge SVGs @ HTML output.
20
+	 */
21
+	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
+	{
23
+		$response = $handler->handle($request);
24 24
 
25
-        if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['svgstore.']['enabled'] ?? false) {
26
-            $processedHtml = $this->svgStoreService->process((string) $response->getBody());
27
-            $response = $response->withBody($this->getStringStream($processedHtml));
28
-        }
25
+		if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['svgstore.']['enabled'] ?? false) {
26
+			$processedHtml = $this->svgStoreService->process((string) $response->getBody());
27
+			$response = $response->withBody($this->getStringStream($processedHtml));
28
+		}
29 29
 
30
-        return $response;
31
-    }
30
+		return $response;
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Classes/Middleware/CleanHtmlMiddleware.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,25 +11,25 @@
 block discarded – undo
11 11
 
12 12
 class CleanHtmlMiddleware extends AbstractMiddleware
13 13
 {
14
-    public function __construct(protected CleanHtmlService $cleanHtmlService)
15
-    {
16
-    }
14
+	public function __construct(protected CleanHtmlService $cleanHtmlService)
15
+	{
16
+	}
17 17
 
18
-    /**
19
-     * Clean the HTML output.
20
-     */
21
-    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
-    {
23
-        $response = $handler->handle($request);
18
+	/**
19
+	 * Clean the HTML output.
20
+	 */
21
+	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
+	{
23
+		$response = $handler->handle($request);
24 24
 
25
-        if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false) {
26
-            $processedHtml = $this->cleanHtmlService->clean(
27
-                (string) $response->getBody(),
28
-                (array) $GLOBALS['TSFE']->config['config']['sourceopt.']
29
-            );
30
-            $response = $response->withBody($this->getStringStream($processedHtml));
31
-        }
25
+		if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false) {
26
+			$processedHtml = $this->cleanHtmlService->clean(
27
+				(string) $response->getBody(),
28
+				(array) $GLOBALS['TSFE']->config['config']['sourceopt.']
29
+			);
30
+			$response = $response->withBody($this->getStringStream($processedHtml));
31
+		}
32 32
 
33
-        return $response;
34
-    }
33
+		return $response;
34
+	}
35 35
 }
Please login to merge, or discard this patch.
Classes/Middleware/RegExRepMiddleware.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,22 +11,22 @@
 block discarded – undo
11 11
 
12 12
 class RegExRepMiddleware extends AbstractMiddleware
13 13
 {
14
-    public function __construct(protected RegExRepService $regExRepService)
15
-    {
16
-    }
14
+	public function __construct(protected RegExRepService $regExRepService)
15
+	{
16
+	}
17 17
 
18
-    /**
19
-     * RegEx search & replace @ HTML output.
20
-     */
21
-    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
-    {
23
-        $response = $handler->handle($request);
18
+	/**
19
+	 * RegEx search & replace @ HTML output.
20
+	 */
21
+	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
22
+	{
23
+		$response = $handler->handle($request);
24 24
 
25
-        if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['replacer.'] ?? false) {
26
-            $processedHtml = $this->regExRepService->process((string) $response->getBody());
27
-            $response = $response->withBody($this->getStringStream($processedHtml));
28
-        }
25
+		if ($this->responseIsAlterable($response) && $GLOBALS['TSFE']->config['config']['replacer.'] ?? false) {
26
+			$processedHtml = $this->regExRepService->process((string) $response->getBody());
27
+			$response = $response->withBody($this->getStringStream($processedHtml));
28
+		}
29 29
 
30
-        return $response;
31
-    }
30
+		return $response;
31
+	}
32 32
 }
Please login to merge, or discard this patch.
Classes/Middleware/AbstractMiddleware.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -13,32 +13,32 @@
 block discarded – undo
13 13
 
14 14
 abstract class AbstractMiddleware implements MiddlewareInterface
15 15
 {
16
-    protected function responseIsAlterable(ResponseInterface $response): bool
17
-    {
18
-        if (!$response instanceof NullResponse) {
19
-            return false;
20
-        }
21
-
22
-        if (!$GLOBALS['TSFE'] instanceof TypoScriptFrontendController) {  // need for configuration
23
-            return false;
24
-        }
25
-
26
-        if ('text/html' !== substr($response->getHeaderLine('Content-Type'), 0, 9)) {
27
-            return false;
28
-        }
29
-
30
-        if (empty($response->getBody())) {
31
-            return false;
32
-        }
33
-
34
-        return true;
35
-    }
36
-
37
-    protected function getStringStream(string $content): StreamInterface
38
-    {
39
-        $body = new Stream('php://temp', 'rw');
40
-        $body->write($content);
41
-
42
-        return $body;
43
-    }
16
+	protected function responseIsAlterable(ResponseInterface $response): bool
17
+	{
18
+		if (!$response instanceof NullResponse) {
19
+			return false;
20
+		}
21
+
22
+		if (!$GLOBALS['TSFE'] instanceof TypoScriptFrontendController) {  // need for configuration
23
+			return false;
24
+		}
25
+
26
+		if ('text/html' !== substr($response->getHeaderLine('Content-Type'), 0, 9)) {
27
+			return false;
28
+		}
29
+
30
+		if (empty($response->getBody())) {
31
+			return false;
32
+		}
33
+
34
+		return true;
35
+	}
36
+
37
+	protected function getStringStream(string $content): StreamInterface
38
+	{
39
+		$body = new Stream('php://temp', 'rw');
40
+		$body->write($content);
41
+
42
+		return $body;
43
+	}
44 44
 }
Please login to merge, or discard this patch.