Test Failed
Push — develop ( df8064...70abbc )
by nguereza
03:01
created
src/Template/Tag/SessionTag.php 2 patches
Braces   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
  * @class SessionTag
60 60
  * @package Platine\Framework\Template\Tag
61 61
  */
62
-class SessionTag extends AbstractTag
63
-{
62
+class SessionTag extends AbstractTag {
64 63
     /**
65 64
      * The key of the session
66 65
      * @var string
@@ -70,12 +69,11 @@  discard block
 block discarded – undo
70 69
     /**
71 70
     * {@inheritdoc}
72 71
     */
73
-    public function __construct(string $markup, &$tokens, Parser $parser)
74
-    {
72
+    public function __construct(string $markup, &$tokens, Parser $parser) {
75 73
         $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/');
76
-        if ($lexer->match($markup)) {
74
+        if ($lexer->match($markup)) {
77 75
             $this->name = $lexer->getStringMatch(0);
78
-        } else {
76
+        } else {
79 77
             throw new ParseException(sprintf(
80 78
                 'Syntax Error in "%s" - Valid syntax: session [key]',
81 79
                 'session'
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,8 @@
 block discarded – undo
68 68
     protected string $name;
69 69
 
70 70
     /**
71
-    * {@inheritdoc}
72
-    */
71
+     * {@inheritdoc}
72
+     */
73 73
     public function __construct(string $markup, &$tokens, Parser $parser)
74 74
     {
75 75
         $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/');
Please login to merge, or discard this patch.
src/Template/Tag/SessionFlashTag.php 2 patches
Braces   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@  discard block
 block discarded – undo
59 59
  * @class SessionFlashTag
60 60
  * @package Platine\Framework\Template\Tag
61 61
  */
62
-class SessionFlashTag extends AbstractTag
63
-{
62
+class SessionFlashTag extends AbstractTag {
64 63
     /**
65 64
      * The key of the session
66 65
      * @var string
@@ -70,12 +69,11 @@  discard block
 block discarded – undo
70 69
     /**
71 70
     * {@inheritdoc}
72 71
     */
73
-    public function __construct(string $markup, &$tokens, Parser $parser)
74
-    {
72
+    public function __construct(string $markup, &$tokens, Parser $parser) {
75 73
         $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/');
76
-        if ($lexer->match($markup)) {
74
+        if ($lexer->match($markup)) {
77 75
             $this->name = $lexer->getStringMatch(0);
78
-        } else {
76
+        } else {
79 77
             throw new ParseException(sprintf(
80 78
                 'Syntax Error in "%s" - Valid syntax: session [key]',
81 79
                 'flash'
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,8 @@
 block discarded – undo
68 68
     protected string $name;
69 69
 
70 70
     /**
71
-    * {@inheritdoc}
72
-    */
71
+     * {@inheritdoc}
72
+     */
73 73
     public function __construct(string $markup, &$tokens, Parser $parser)
74 74
     {
75 75
         $lexer = new Lexer('/' . Token::QUOTED_FRAGMENT . '/');
Please login to merge, or discard this patch.
src/Template/Tag/CsrfTag.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
  * @package Platine\Framework\Template\Tag
58 58
  * @template T
59 59
  */
60
-class CsrfTag extends AbstractTag
61
-{
60
+class CsrfTag extends AbstractTag {
62 61
     /**
63 62
      * {@inheritdoc}
64 63
      */
Please login to merge, or discard this patch.
src/Handler/Error/Renderer/AbstractErrorRenderer.php 1 patch
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * @class AbstractErrorRenderer
56 56
  * @package Platine\Framework\Handler\Error\Renderer
57 57
  */
58
-abstract class AbstractErrorRenderer implements ErrorRenderInterface
59
-{
58
+abstract class AbstractErrorRenderer implements ErrorRenderInterface {
60 59
     /**
61 60
      * The default error title
62 61
      * @var string
@@ -78,7 +77,7 @@  discard block
 block discarded – undo
78 77
      */
79 78
     protected function getErrorTitle(Throwable $exception): string
80 79
     {
81
-        if ($exception instanceof HttpException) {
80
+        if ($exception instanceof HttpException) {
82 81
             return $exception->getTitle();
83 82
         }
84 83
 
@@ -93,7 +92,7 @@  discard block
 block discarded – undo
93 92
      */
94 93
     protected function getErrorDescription(Throwable $exception): string
95 94
     {
96
-        if ($exception instanceof HttpException) {
95
+        if ($exception instanceof HttpException) {
97 96
             return $exception->getDescription();
98 97
         }
99 98
 
Please login to merge, or discard this patch.
src/Handler/Error/Renderer/XmlErrorRenderer.php 1 patch
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * @class XmlErrorRenderer
55 55
  * @package Platine\Framework\Handler\Error\Renderer
56 56
  */
57
-class XmlErrorRenderer extends AbstractErrorRenderer
58
-{
57
+class XmlErrorRenderer extends AbstractErrorRenderer {
59 58
     /**
60 59
      * {@inheritdoc}
61 60
      */
@@ -65,9 +64,9 @@  discard block
 block discarded – undo
65 64
         $xml .= '<error>';
66 65
         $xml .= '<message>' . $this->addCharacterData($exception->getMessage()) . '</message>';
67 66
 
68
-        if ($detail) {
67
+        if ($detail) {
69 68
             $xml .= '<exceptions>';
70
-            do {
69
+            do {
71 70
                 $xml .= $this->getExceptionXml($exception);
72 71
             } while ($exception = $exception->getPrevious());
73 72
             $xml .= '</exceptions>';
Please login to merge, or discard this patch.
src/Handler/Error/Renderer/HtmlErrorRenderer.php 1 patch
Braces   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,14 +55,13 @@  discard block
 block discarded – undo
55 55
  * @class HtmlErrorRenderer
56 56
  * @package Platine\Framework\Handler\Error\Renderer
57 57
  */
58
-class HtmlErrorRenderer extends AbstractErrorRenderer
59
-{
58
+class HtmlErrorRenderer extends AbstractErrorRenderer {
60 59
     /**
61 60
      * {@inheritdoc}
62 61
      */
63 62
     public function render(Throwable $exception, bool $detail, bool $isLog = false): string
64 63
     {
65
-        if ($isLog) {
64
+        if ($isLog) {
66 65
             return sprintf(
67 66
                 '%s: %s, %s',
68 67
                 $this->getErrorTitle($exception),
@@ -71,11 +70,11 @@  discard block
 block discarded – undo
71 70
             );
72 71
         }
73 72
 
74
-        if ($detail) {
73
+        if ($detail) {
75 74
             $html = '<p>The application could not run because of the following error:</p>';
76 75
             $html .= '<h2>Details</h2>';
77 76
             $html .= $this->renderException($exception);
78
-        } else {
77
+        } else {
79 78
             $html = sprintf('<p>%s</p>', $this->getErrorDescription($exception));
80 79
         }
81 80
 
@@ -95,12 +94,12 @@  discard block
 block discarded – undo
95 94
         );
96 95
 
97 96
         $code = $exception->getCode();
98
-        if ($code !== null) {
97
+        if ($code !== null) {
99 98
             $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code);
100 99
         }
101 100
 
102 101
         $message = $exception->getMessage();
103
-        if ($message !== null) {
102
+        if ($message !== null) {
104 103
             $html .= sprintf(
105 104
                 '<div><strong>Message:</strong> %s</div>',
106 105
                 htmlentities($message)
@@ -108,17 +107,17 @@  discard block
 block discarded – undo
108 107
         }
109 108
 
110 109
         $file = $exception->getFile();
111
-        if ($file !== null) {
110
+        if ($file !== null) {
112 111
             $html .= sprintf('<div><strong>File:</strong> %s</div>', $file);
113 112
         }
114 113
 
115 114
         $line = $exception->getLine();
116
-        if ($line !== null) {
115
+        if ($line !== null) {
117 116
             $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line);
118 117
         }
119 118
 
120 119
         $trace = $exception->getTraceAsString();
121
-        if ($trace !== null) {
120
+        if ($trace !== null) {
122 121
             $html .= '<h2>Trace</h2>';
123 122
             $html .= sprintf('<pre>%s</pre>', htmlentities($trace));
124 123
         }
Please login to merge, or discard this patch.
src/Handler/Error/Renderer/TextPlainErrorRenderer.php 1 patch
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * @class TextPlainErrorRenderer
55 55
  * @package Platine\Framework\Handler\Error\Renderer
56 56
  */
57
-class TextPlainErrorRenderer extends AbstractErrorRenderer
58
-{
57
+class TextPlainErrorRenderer extends AbstractErrorRenderer {
59 58
     /**
60 59
      * {@inheritdoc}
61 60
      */
@@ -63,13 +62,13 @@  discard block
 block discarded – undo
63 62
     {
64 63
         $error = $this->getErrorTitle($exception) . "\n";
65 64
 
66
-        if ($isLog) {
65
+        if ($isLog) {
67 66
             return $error;
68 67
         }
69 68
 
70
-        if ($detail) {
69
+        if ($detail) {
71 70
             $error .= $this->getExceptionText($exception);
72
-            while ($exception = $exception->getPrevious()) {
71
+            while ($exception = $exception->getPrevious()) {
73 72
                 $error .= "\nPrevious Error:\n";
74 73
                 $error .= $this->getExceptionText($exception);
75 74
             }
Please login to merge, or discard this patch.
src/Handler/Error/Renderer/JsonErrorRenderer.php 1 patch
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
  * @class JsonErrorRenderer
56 56
  * @package Platine\Framework\Handler\Error\Renderer
57 57
  */
58
-class JsonErrorRenderer extends AbstractErrorRenderer
59
-{
58
+class JsonErrorRenderer extends AbstractErrorRenderer {
60 59
     /**
61 60
      * {@inheritdoc}
62 61
      */
@@ -67,9 +66,9 @@  discard block
 block discarded – undo
67 66
             'message' => $this->getErrorDescription($exception),
68 67
         ];
69 68
 
70
-        if ($detail) {
69
+        if ($detail) {
71 70
             $error['exception'] = [];
72
-            do {
71
+            do {
73 72
                 $error['exception'][] = $this->getExceptionData($exception);
74 73
             } while ($exception = $exception->getPrevious());
75 74
         }
Please login to merge, or discard this patch.
src/Handler/Error/ErrorHandlerInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
  * @class ErrorHandlerInterface
57 57
  * @package Platine\Framework\Handler\Error
58 58
  */
59
-interface ErrorHandlerInterface
60
-{
59
+interface ErrorHandlerInterface {
61 60
     /**
62 61
      * Handle error and generate the response
63 62
      * @param ServerRequestInterface $request
Please login to merge, or discard this patch.