Browse Source

Fix CS errors

ADmad 3 years ago
parent
commit
2827334df5

+ 7 - 7
src/Error/Renderer/WebExceptionRenderer.php

@@ -69,28 +69,28 @@ class WebExceptionRenderer implements ExceptionRendererInterface
      *
      * @var \Throwable
      */
-    protected $error;
+    protected Throwable $error;
 
     /**
      * Controller instance.
      *
      * @var \Cake\Controller\Controller
      */
-    protected $controller;
+    protected Controller $controller;
 
     /**
      * Template to render for {@link \Cake\Core\Exception\CakeException}
      *
      * @var string
      */
-    protected $template = '';
+    protected string $template = '';
 
     /**
      * The method corresponding to the Exception this object is for.
      *
      * @var string
      */
-    protected $method = '';
+    protected string $method = '';
 
     /**
      * If set, this will be request used to create the controller that will render
@@ -98,7 +98,7 @@ class WebExceptionRenderer implements ExceptionRendererInterface
      *
      * @var \Cake\Http\ServerRequest|null
      */
-    protected $request;
+    protected ?ServerRequest $request;
 
     /**
      * Map of exceptions to http status codes.
@@ -109,7 +109,7 @@ class WebExceptionRenderer implements ExceptionRendererInterface
      * @var array<string, int>
      * @psalm-var array<class-string<\Throwable>, int>
      */
-    protected $exceptionHttpCodes = [
+    protected array $exceptionHttpCodes = [
         // Controller exceptions
         InvalidParameterException::class => 404,
         MissingActionException::class => 404,
@@ -284,7 +284,7 @@ class WebExceptionRenderer implements ExceptionRendererInterface
      * @param \Psr\Http\Message\ResponseInterface|string $output The response to output.
      * @return void
      */
-    public function write($output): void
+    public function write(ResponseInterface|string $output): void
     {
         if (is_string($output)) {
             echo $output;

+ 1 - 1
src/View/Form/FormContext.php

@@ -40,7 +40,7 @@ class FormContext implements ContextInterface
      *
      * @var string|null
      */
-    protected $_validator = null;
+    protected ?string $_validator = null;
 
     /**
      * Constructor.

+ 1 - 1
tests/Fixture/ArticlesTagsBindingKeysFixture.php

@@ -26,7 +26,7 @@ class ArticlesTagsBindingKeysFixture extends TestFixture
      *
      * @var array
      */
-    public $records = [
+    public array $records = [
         ['article_id' => 1, 'tagname' => 'tag1'],
         ['article_id' => 1, 'tagname' => 'tag2'],
         ['article_id' => 2, 'tagname' => 'tag1'],