Skip to content

Commit

Permalink
Simplify default value query
Browse files Browse the repository at this point in the history
  • Loading branch information
gazben authored Nov 5, 2024
1 parent 655c547 commit c2a0820
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SettingsMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ private function fillMissingSettingsWithDefaultValues(SettingsConfig $config, Co
->each(function($missingSetting) use ($config, &$properties) {
/** @var ReflectionProperty $reflectionProperty */
$reflectionProperty = $config->getReflectedProperties()[$missingSetting];
$defaultValue = $reflectionProperty->getDefaultValue();
if (! is_null($defaultValue) || $reflectionProperty->getType()->allowsNull()) {
$properties->put($missingSetting, $defaultValue);

if ($reflectionProperty->hasDefaultValue() || $reflectionProperty->getType()->allowsNull()) {
$properties->put($missingSetting, $reflectionProperty->getDefaultValue());
}
});

Expand Down

0 comments on commit c2a0820

Please sign in to comment.