Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninmasek authored and github-actions[bot] committed Jun 26, 2023
1 parent 82da4f4 commit 7c8e2aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Hydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public static function hydrate(string $className, array $data = null): ?object
return null;
}

$data = Arr::mapKeys($data, function($key) {
$data = Arr::mapKeys($data, function ($key) {
return Str::removeSpaces($key);
});

$reflectionClass = new \ReflectionObject($dto = new $className());
$publicProperties = $reflectionClass->getProperties(\ReflectionProperty::IS_PUBLIC);

foreach ($publicProperties as $property) {
$value = array_key_exists($property->getName(),$data)
$value = array_key_exists($property->getName(), $data)
? $data[$property->getName()]
: null;

Expand Down
2 changes: 1 addition & 1 deletion src/Support/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function isList(array $array): bool
*/
public static function mapKeys(array $array, Closure $callback): array
{
$newKeys = array_map(
$newKeys = array_map(
$callback,
array_keys($array),
$array,
Expand Down

0 comments on commit 7c8e2aa

Please sign in to comment.