diff --git a/package-lock.json b/package-lock.json index 3ed45d9b4..563d5b6cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "devDependencies": { - "@prettier/plugin-php": "^0.22.2", + "@prettier/plugin-php": "^0.22.4", "@stoplight/spectral-cli": "^6.14.2" } }, @@ -90,10 +90,11 @@ } }, "node_modules/@prettier/plugin-php": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.22.2.tgz", - "integrity": "sha512-md0+7tNbsP0oy+wIP3KZZc6fzx1k1jtWaMjOy/gM8yU9f2BDYEi+iHOc/UNPihYvPI28zFTbjvlhH4QXQjQwNg==", + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.22.4.tgz", + "integrity": "sha512-uZWqfyrwsxScIYkmVcfnoQGFmKVMXTHD5pqYT4l8fxzm5P3XY94hTPbf8X6TFCi2QTZBIot7GS8lfIjQjldc2g==", "dev": true, + "license": "MIT", "dependencies": { "linguist-languages": "^7.27.0", "php-parser": "^3.1.5" diff --git a/package.json b/package.json index 7da41354b..a496dcf41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@prettier/plugin-php": "^0.22.2", + "@prettier/plugin-php": "^0.22.4", "@stoplight/spectral-cli": "^6.14.2" } } diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Auth.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Auth.inc index 94f99bbf3..0c2c0876c 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Auth.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Auth.inc @@ -101,15 +101,13 @@ class Auth { * Provides additional logic whenever authentication is successful. This is intended to be overridden by a * child Auth class when it needs something specific to happen after a client successfully authenticates. */ - protected function on_successful_auth(): void { - } + protected function on_successful_auth(): void {} /** * Provides additional logic whenever authentication has failed. This is intended to be overridden by a * child Auth class when it needs something specific to happen after a client fails to authenticate. */ - protected function on_failed_auth(): void { - } + protected function on_failed_auth(): void {} /** * Defines the steps required for users to authenticate wit this authentication method. This method must be diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Field.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Field.inc index e5fb9bec5..7fe5a5de3 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Field.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Field.inc @@ -479,8 +479,7 @@ class Field { * @param mixed $value The value being validated. In the event that this is a `many` field, this method will * receive each value of the array individually, not the array value itself. */ - public function validate_extra(mixed $value): void { - } + public function validate_extra(mixed $value): void {} /** * Ensures this field has a parent model context assigned if a parent model context is required. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Form.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Form.inc index 906aa609c..d90e39454 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Form.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Form.inc @@ -361,8 +361,7 @@ class Form { * Performs tasks when the Form page is initially loaded. This method is intended to be overridden by the child * class. */ - public function on_load(): void { - } + public function on_load(): void {} /** * Performs validation and saves the Model assigned to this ModelForm. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc index 1e0604487..c8c4caf3f 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/Model.inc @@ -1288,8 +1288,7 @@ class Model { * Allows child classes to define extra validation for their Models. This can be used to build complex validations * that check conditions between multiple Model fields. */ - public function validate_extra(): void { - } + public function validate_extra(): void {} /** * Performs a full validation on the API model. This includes checking that required packages are installed and @@ -1612,15 +1611,13 @@ class Model { * Initializes the default 'pre_apply' method. This method is intended to be overidden by a child model class and * is called immediately before the 'apply' method. This method runs regardless of whether an apply was requested. */ - protected function pre_apply() { - } + protected function pre_apply() {} /** * Initializes the default 'apply' method. This method is intended to be overridden by a child model class and is * responsible for reloading/restarting services after changes occur. */ - public function apply() { - } + public function apply() {} /** * Initializes the default 'pre_apply_create' method. This method is intended to be overridden by a child model class and diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/TestCase.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/TestCase.inc index b9a2c97e0..d17e1f1ea 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/TestCase.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/TestCase.inc @@ -129,15 +129,13 @@ class TestCase { * Sets up the test case before tests are run. This can be overridden by your TestCase to setup shared resources * required for your tests. */ - public function setup(): void { - } + public function setup(): void {} /** * Tears down the test case after tests are run. This can be overridden by your TestCase to destroy resources * that may have been created during tests. */ - public function teardown(): void { - } + public function teardown(): void {} /** * Obtains the environment variable with a given name. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/GraphQL/Resolver.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/GraphQL/Resolver.inc index 2fcbc6be8..a75cbcd22 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/GraphQL/Resolver.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/GraphQL/Resolver.inc @@ -18,8 +18,7 @@ class Resolver { * Constructs the GraphQLResolver object with a given Model object. * @param Model $model The Model object to be used for resolving queries and mutations. */ - public function __construct(public Model $model) { - } + public function __construct(public Model $model) {} /** * A resolver that maps a GraphQL query to the Model's 'query' method. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServerApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServerApply.inc index 8dfafc160..5c8b47112 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServerApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServerApply.inc @@ -39,8 +39,7 @@ class DHCPServerApply extends Model { /** * Overrides the default _create() method but does nothing. This model is only intended to apply pending changes. */ - protected function _create(): void { - } + protected function _create(): void {} /** * Applies changes to the DHCP server configuration. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSForwarderApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSForwarderApply.inc index 812a3fb80..47172b825 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSForwarderApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSForwarderApply.inc @@ -41,8 +41,7 @@ class DNSForwarderApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending DNS Resolver changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSResolverApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSResolverApply.inc index 3be3c35fd..800e7d9ea 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSResolverApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DNSResolverApply.inc @@ -41,8 +41,7 @@ class DNSResolverApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending DNS Resolver changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/HAProxyApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/HAProxyApply.inc index 546d2b1b0..cbb34fc99 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/HAProxyApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/HAProxyApply.inc @@ -42,8 +42,7 @@ class HAProxyApply extends Model { /** * Overrides the default _create method to do nothing. We only want to apply. */ - public function _create() { - } + public function _create() {} /** * Applies changes to the HAProxy configuration. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/IPsecApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/IPsecApply.inc index eeccd178f..78c76a2ac 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/IPsecApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/IPsecApply.inc @@ -41,8 +41,7 @@ class IPsecApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending IPsec changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RoutingApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RoutingApply.inc index 9cf1cbaf0..0390949fa 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RoutingApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RoutingApply.inc @@ -40,8 +40,7 @@ class RoutingApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending routing changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/VirtualIPApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/VirtualIPApply.inc index 382c0ce1a..cfe686c4a 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/VirtualIPApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/VirtualIPApply.inc @@ -41,8 +41,7 @@ class VirtualIPApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/WireGuardApply.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/WireGuardApply.inc index f6d59d5d7..9688a6199 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/WireGuardApply.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/WireGuardApply.inc @@ -41,8 +41,7 @@ class WireGuardApply extends Model { /** * Override the _create method so it does nothing. We only want to apply changes when this is called. */ - public function _create(): void { - } + public function _create(): void {} /** * Applies pending DNS Resolver changes. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc index dcdc35d40..7ef312e2f 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Schemas/GraphQLSchema.inc @@ -468,18 +468,14 @@ class GraphQLSchema extends Schema { # Require an ID if the Model is a many Model if ($endpoint->model->many) { $args['id'] = [ - 'type' => $this->get_model_object_type($endpoint->model_name) - ->getField('id') - ->getType(), + 'type' => $this->get_model_object_type($endpoint->model_name)->getField('id')->getType(), 'description' => 'The ID of the object to read.', ]; } # Require a parent ID if the Model has a parent Model if ($endpoint->model->parent_model_class) { $args['parent_id'] = [ - 'type' => $this->get_model_object_type($endpoint->model_name) - ->getField('parent_id') - ->getType(), + 'type' => $this->get_model_object_type($endpoint->model_name)->getField('parent_id')->getType(), 'description' => 'The parent ID of the object to read.', ]; } diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/IPAddressValidator.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/IPAddressValidator.inc index 4c8f0791f..adaa3360c 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/IPAddressValidator.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/IPAddressValidator.inc @@ -29,8 +29,7 @@ class IPAddressValidator extends RESTAPI\Core\Validator { public bool $allow_fqdn = false, public bool $allow_port = false, public array $allow_keywords = [], - ) { - } + ) {} /** * Checks if a given value is a valid IP address. diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/X509Validator.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/X509Validator.inc index db9c5158b..ce243c7a3 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/X509Validator.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Validators/X509Validator.inc @@ -38,8 +38,7 @@ class X509Validator extends Validator { public bool $allow_prv = false, public bool $allow_rsa = false, public bool $allow_ecprv = false, - ) { - } + ) {} /** * Checks if a given value is a valid X509 string.