From 816315c0807d52f63cd46e4726d23ec6a5c14b5a Mon Sep 17 00:00:00 2001 From: Tim Bischoff Date: Fri, 10 Nov 2023 14:57:48 +0100 Subject: [PATCH] Set union types to class properties in the helpers and components examples (#7763) * Update components.rst Set union types to class properties in the component example * Update helpers.rst Set union types to class properties in the helpers examples --- en/controllers/components.rst | 2 +- en/views/helpers.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/en/controllers/components.rst b/en/controllers/components.rst index fb0b6ea190..774fa65fec 100644 --- a/en/controllers/components.rst +++ b/en/controllers/components.rst @@ -234,7 +234,7 @@ You can load other components by adding them to the `$components` property:: class CustomComponent extends Component { // The other component your component uses - protected $components = ['Existing']; + protected array $components = ['Existing']; // Execute any other additional setup for your component. public function initialize(array $config): void diff --git a/en/views/helpers.rst b/en/views/helpers.rst index 5c603d7789..f393807058 100644 --- a/en/views/helpers.rst +++ b/en/views/helpers.rst @@ -122,7 +122,7 @@ your helper requires. For example:: /** * @var array */ - protected $_defaultConfig = [ + protected array $_defaultConfig = [ 'errorClass' => 'error', 'templates' => [ 'label' => '', @@ -268,7 +268,7 @@ just as you would in a controller:: class LinkHelper extends Helper { - protected $helpers = ['Html']; + protected array $helpers = ['Html']; public function makeEdit($title, $url) { @@ -317,7 +317,7 @@ If you would like to access a View variable inside a helper, you can use class AwesomeHelper extends Helper { - public $helpers = ['Html']; + public array $helpers = ['Html']; public function someMethod() {