Skip to content

Commit

Permalink
Php8 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
thefrosty committed Jun 23, 2023
1 parent d4adad8 commit 858d547
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/Settings/FieldManager.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Dwnload\WpSettingsApi\Settings;

Expand All @@ -22,7 +24,7 @@ class FieldManager
* Set an array of new SettingField objects.
* @param SettingField[] $fields An array of `SettingField` objects.
*/
public function setFields(array $fields)
public function setFields(array $fields): void
{
array_push(self::$settings_fields, ...$fields);
}
Expand All @@ -31,7 +33,7 @@ public function setFields(array $fields)
* Add a new SettingField object.
* @param SettingField $field The `SettingField` object.
*/
public function addField(SettingField $field)
public function addField(SettingField $field): void
{
self::$settings_fields[$field->getSectionId()][] = $field;
}
Expand Down
8 changes: 5 additions & 3 deletions src/Settings/SectionManager.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Dwnload\WpSettingsApi\Settings;

Expand Down Expand Up @@ -29,15 +31,15 @@ public function __construct(WpSettingsApi $wp_settings_api)

/**
* Array of SettingSection objects.
* @var array SettingSection[]
* @var array<SettingSection> $settings_sections
*/
protected static array $settings_sections = [];

/**
* Set settings sections
* @param SettingSection[] $sections An array of SettingSection objects.
*/
public function setSections(array $sections)
public function setSections(array $sections): void
{
self::$settings_sections[$this->wp_settings_api->getPluginInfo()->getMenuSlug()] = $sections;
}
Expand Down

0 comments on commit 858d547

Please sign in to comment.