Skip to content

Commit d2d015b

Browse files
committed
chore: Run CS Fixer
1 parent 6de946b commit d2d015b

99 files changed

Lines changed: 3844 additions & 3650 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

WebFiori/Http/APIFilter.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*
@@ -21,7 +22,6 @@
2122
*
2223
*/
2324
class APIFilter {
24-
private $requestParameters = [];
2525
/**
2626
* A constant that indicates a given value is invalid.
2727
*
@@ -57,6 +57,7 @@ class APIFilter {
5757
*
5858
*/
5959
private $paramDefs = [];
60+
private $requestParameters = [];
6061
/**
6162
* Adds a new request parameter to the filter.
6263
*
@@ -106,9 +107,6 @@ public function addRequestParameter(RequestParameter $reqParam) {
106107
$this->paramDefs[] = $attribute;
107108
$this->requestParameters[] = $reqParam;
108109
}
109-
public function getParameters() : array {
110-
return $this->requestParameters;
111-
}
112110
/**
113111
* Clears the arrays that are used to store filtered and not-filtered variables.
114112
*
@@ -200,17 +198,6 @@ public static function filter(APIFilter $apiFilter, array $arr): array {
200198

201199
return $retVal;
202200
}
203-
private static function decodeArray(array $array) {
204-
$retVal = [];
205-
foreach ($array as $arrEl) {
206-
if (gettype($arrEl) == 'array') {
207-
$retVal[] = self::decodeArray($arrEl);
208-
} else {
209-
$retVal[] = urldecode($arrEl.'');
210-
}
211-
}
212-
return $retVal;
213-
}
214201
/**
215202
* Validate and sanitize GET parameters.
216203
*
@@ -321,6 +308,9 @@ public function getInputStreamPath() {
321308
public final function getNonFiltered() {
322309
return $this->nonFilteredInputs;
323310
}
311+
public function getParameters() : array {
312+
return $this->requestParameters;
313+
}
324314
/**
325315
* Sets the stream at which the filter will use to read the inputs.
326316
*
@@ -557,6 +547,19 @@ private function cleanJsonStr($extraClean, $def, $toBeFiltered) {
557547
$extraClean->add($name, null);
558548
}
559549
}
550+
private static function decodeArray(array $array) {
551+
$retVal = [];
552+
553+
foreach ($array as $arrEl) {
554+
if (gettype($arrEl) == 'array') {
555+
$retVal[] = self::decodeArray($arrEl);
556+
} else {
557+
$retVal[] = urldecode($arrEl.'');
558+
}
559+
}
560+
561+
return $retVal;
562+
}
560563
/**
561564
* Converts a string to an array.
562565
*

0 commit comments

Comments
 (0)