Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed May 12, 2024
1 parent 51d7064 commit 0ca1dbd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Fortress/Transformer/RequestDataTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function transform(

// 1. If we skip or error on unexpected var, purge unwanted fields
if ($onUnexpectedVar === 'skip' || $onUnexpectedVar === 'error') {
$data = $this->purge($schemaFields, $data, ($onUnexpectedVar === 'error'));
$data = $this->purge($schemaFields, $data, $onUnexpectedVar === 'error');
}

// 2° Apply each transformation rules. Skip we field as no transformation rules
Expand Down Expand Up @@ -176,7 +176,8 @@ protected function applyTransformation(array $rules, mixed $value): mixed
* @param bool $throw If true, a FortressException will be thrown if something to purge is found
*
* @throws FortressException If $throw is true and we found something to purge
* @return mixed[] The purged data
*
* @return mixed[] The purged data
*/
protected function purge(array $schemaFields, array $data, bool $throw = false): array
{
Expand Down Expand Up @@ -223,8 +224,8 @@ protected function purge(array $schemaFields, array $data, bool $throw = false):
* Purge a set of nested keys.
*
* @param string[] $keys Nested keys. Dot notation keys (eg. 'foo.bar')
* represented as an array (eg. array('foo', 'bar'))
* @param mixed[] $data The data to purge from
* represented as an array (eg. array('foo', 'bar'))
* @param mixed[] $data The data to purge from
*
* @return mixed[] The purged data
*/
Expand Down Expand Up @@ -354,6 +355,7 @@ protected function purify(mixed $value): mixed
/**
* Applies the callback to the elements of the given arrays recursively.
* Required to apply transformation on multidimensional arrays.
*
* @see https://stackoverflow.com/a/39637749/445757
*
* @param callable $callback
Expand Down

0 comments on commit 0ca1dbd

Please sign in to comment.