Skip to content

Commit 9b27398

Browse files
style: run prettier on changed files
1 parent 2d1eca4 commit 9b27398

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/ModelCache.inc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ class ModelCache {
114114
if ($model->parent_model_class) {
115115
throw new ServerError(
116116
message: "Cannot index Model class '" .
117-
$model->get_class_fqn() .
118-
"' because it has a parent model class '" .
119-
$model->parent_model_class .
120-
"'.",
117+
$model->get_class_fqn() .
118+
"' because it has a parent model class '" .
119+
$model->parent_model_class .
120+
"'.",
121121
response_id: 'MODEL_CACHE_INDEX_FIELD_ON_PARENTED_MODEL',
122122
);
123123
}
@@ -131,9 +131,9 @@ class ModelCache {
131131
if (!$model->$index_field->unique) {
132132
throw new ServerError(
133133
message: "Cannot index Model class '" .
134-
$model->get_class_fqn() .
135-
"' by non-unique field " .
136-
"'$index_field'.",
134+
$model->get_class_fqn() .
135+
"' by non-unique field " .
136+
"'$index_field'.",
137137
response_id: 'MODEL_CACHE_INDEX_FIELD_NOT_UNIQUE',
138138
);
139139
}
@@ -212,7 +212,7 @@ class ModelCache {
212212
if (!self::has_model($model_class, $index_field, $index_value)) {
213213
throw new NotFoundError(
214214
message: "No cached Model found for Model class '$model_class' with " .
215-
"index field '$index_field' and index value '$index_value'.",
215+
"index field '$index_field' and index value '$index_value'.",
216216
response_id: 'MODEL_CACHE_MODEL_NOT_FOUND',
217217
);
218218
}
@@ -226,7 +226,6 @@ class ModelCache {
226226
return self::$index[$model_class];
227227
}
228228

229-
230229
/**
231230
* Clears the ModelCache of all cached ModelSets and indexed Model objects.
232231
*/

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core/ModelSet.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ class ModelSet {
197197
* @param array $query_params An associative array of query parameters to use to generate the signature.
198198
* @return string The signature for the given query parameters.
199199
*/
200-
public function get_query_signature(array $query_params = []): string
201-
{
200+
public function get_query_signature(array $query_params = []): string {
202201
# ModelSet is cache exempt if there is no existing signature
203202
if (!$this->signature) {
204203
return '';

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Fields/ForeignModelField.inc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,13 @@ class ForeignModelField extends Field {
251251
$model_name = $model->get_class_fqn();
252252

253253
# Check if a Model object is indexed by this internal value
254-
if ($model_cache::has_model($model_name, index_field: $this->model_field_internal, index_value: $internal_value)) {
254+
if (
255+
$model_cache::has_model(
256+
$model_name,
257+
index_field: $this->model_field_internal,
258+
index_value: $internal_value,
259+
)
260+
) {
255261
return $model_cache::fetch_model(
256262
model_class: $model_name,
257263
index_field: $this->model_field_internal,

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RESTAPIAccessListEntry.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class RESTAPIAccessListEntry extends Model {
6060
many: true,
6161
many_minimum: 0,
6262
help_text: 'The users that this entry applies to. Only users in this list will be affected by this ' .
63-
'entry. Leave empty if this entry should apply to all users.',
63+
'entry. Leave empty if this entry should apply to all users.',
6464
);
6565
$this->sched = new ForeignModelField(
6666
model_name: 'FirewallSchedule',

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APICoreModelCacheTestCase.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ class APICoreModelCacheTestCase extends TestCase {
8787
/**
8888
* Ensures a ModelSet without a signature cannot be cached in the ModelCache.
8989
*/
90-
public function test_model_cache_cache_modelset_without_signature_throws_error(): void
91-
{
90+
public function test_model_cache_cache_modelset_without_signature_throws_error(): void {
9291
# Obtain and clear the ModelCache
9392
$model_cache = ModelCache::get_instance();
9493
$model_cache::clear();

0 commit comments

Comments
 (0)