Skip to content

Commit 816315c

Browse files
authored
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
1 parent 714bbe2 commit 816315c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

en/controllers/components.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ You can load other components by adding them to the `$components` property::
234234
class CustomComponent extends Component
235235
{
236236
// The other component your component uses
237-
protected $components = ['Existing'];
237+
protected array $components = ['Existing'];
238238

239239
// Execute any other additional setup for your component.
240240
public function initialize(array $config): void

en/views/helpers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ your helper requires. For example::
122122
/**
123123
* @var array<string, mixed>
124124
*/
125-
protected $_defaultConfig = [
125+
protected array $_defaultConfig = [
126126
'errorClass' => 'error',
127127
'templates' => [
128128
'label' => '<label for="{{for}}">{{content}}</label>',
@@ -268,7 +268,7 @@ just as you would in a controller::
268268

269269
class LinkHelper extends Helper
270270
{
271-
protected $helpers = ['Html'];
271+
protected array $helpers = ['Html'];
272272

273273
public function makeEdit($title, $url)
274274
{
@@ -317,7 +317,7 @@ If you would like to access a View variable inside a helper, you can use
317317

318318
class AwesomeHelper extends Helper
319319
{
320-
public $helpers = ['Html'];
320+
public array $helpers = ['Html'];
321321

322322
public function someMethod()
323323
{

0 commit comments

Comments
 (0)