Skip to content

Commit

Permalink
Refactor code to use parameter, return type hints
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
  • Loading branch information
sampoyigi committed Jan 14, 2024
1 parent 4301986 commit 6806647
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/ApiResources/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class Webhooks extends ApiController
{
public $implement = [
public array $implement = [
\Igniter\Api\Http\Actions\RestController::class,
];

Expand Down
8 changes: 4 additions & 4 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function boot()
}
}

public function registerSettings()
public function registerSettings(): array
{
return [
'settings' => [
Expand All @@ -62,7 +62,7 @@ public function registerSettings()
*
* @return array
*/
public function registerPermissions()
public function registerPermissions(): array
{
return [
'IgniterLabs.Webhook.ManageSetting' => [
Expand All @@ -72,7 +72,7 @@ public function registerPermissions()
];
}

public function registerNavigation()
public function registerNavigation(): array
{
return [
'tools' => [
Expand All @@ -89,7 +89,7 @@ public function registerNavigation()
];
}

public function registerSchedule($schedule)
public function registerSchedule(string $schedule)
{
$schedule->command('webhook:cleanup')->name('Webhook Log Cleanup')->daily();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Controllers/Outgoing.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
*/
class Outgoing extends \Igniter\Admin\Classes\AdminController
{
public $implement = [
public array $implement = [
\Igniter\Admin\Http\Actions\FormController::class,
\Igniter\Admin\Http\Actions\ListController::class,
];

public $listConfig = [
public array $listConfig = [
'list' => [
'model' => \IgniterLabs\Webhook\Models\Outgoing::class,
'title' => 'lang:igniterlabs.webhook::default.outgoing.text_title',
Expand All @@ -26,7 +26,7 @@ class Outgoing extends \Igniter\Admin\Classes\AdminController
],
];

public $formConfig = [
public array $formConfig = [
'name' => 'lang:igniterlabs.webhook::default.outgoing.text_form_name',
'model' => \IgniterLabs\Webhook\Models\Outgoing::class,
'request' => \IgniterLabs\Webhook\Requests\Outgoing::class,
Expand All @@ -50,7 +50,7 @@ class Outgoing extends \Igniter\Admin\Classes\AdminController
'configFile' => 'outgoing',
];

protected $requiredPermissions = 'IgniterLabs.Webhook.*';
protected null|string|array $requiredPermissions = 'IgniterLabs.Webhook.*';

public function __construct()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

class Settings extends Model
{
public $implement = [\Igniter\System\Actions\SettingsModel::class];
public array $implement = [\Igniter\System\Actions\SettingsModel::class];

// A unique code
public $settingsCode = 'igniterlabs_webhook_settings';
public string $settingsCode = 'igniterlabs_webhook_settings';

// Reference to field configuration
public $settingsFieldsConfig = 'settings';
public string $settingsFieldsConfig = 'settings';
}

0 comments on commit 6806647

Please sign in to comment.