Skip to content

Commit

Permalink
style: Fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
aydinfatih committed Mar 14, 2024
1 parent 5218b68 commit 11df5f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/Casts/ConfigValueCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public function get(Model $model, string $key, mixed $value, array $attributes)
{
switch ($attributes['type']) {
case ConfigDataType::BOOLEAN->value:
return (bool)$value;
return (bool) $value;
case ConfigDataType::INTEGER->value:
return (int)$value;
return (int) $value;
case ConfigDataType::DATE->value:
return Carbon::createFromFormat('Y-m-d', $value);
case ConfigDataType::DATE_TIME->value:
Expand Down
26 changes: 13 additions & 13 deletions tests/LaravelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public function it_create_a_new_config_parameter(): void
{
$factory = new ConfigFactory();
$configItem = $factory->setName(Str::random(5))
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();

$this->laravelConfig->create($configItem);

Expand Down Expand Up @@ -75,10 +75,10 @@ public function it_does_not_create_a_config_parameter_with_the_same_name(): void

$factory = new ConfigFactory();
$configItem = $factory->setName($config->name)
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();

$response = $this->laravelConfig->create($configItem);

Expand All @@ -93,9 +93,9 @@ public function it_updates_existing_config_parameter(): void

$factory = new ConfigFactory($config);
$configItem = $factory->setType(ConfigDataType::BOOLEAN)
->setValue('0')
->setDescription('updated-description')
->get();
->setValue('0')
->setDescription('updated-description')
->get();

$this->laravelConfig->update($config, $configItem);

Expand Down Expand Up @@ -273,7 +273,7 @@ public function it_returns_json_value_for_json_type_config_parameter_if_exists()
{
$config = factory(Config::class)->create([
'name' => 'yunus.was.here',
'val' => [9 => [7,8,9], 2 => [7,8,9], 31 => [10,11,12]],
'val' => [9 => [7, 8, 9], 2 => [7, 8, 9], 31 => [10, 11, 12]],
'type' => ConfigDataType::JSON,
]);

Expand All @@ -292,7 +292,7 @@ public function it_returns_in_caster_type_if_type_is_custom_caster_with_param():
$config = factory(Config::class)->create([
'name' => 'fatih.was.here',
'val' => [ConfigDataType::DATE],
'type' => AsEnumCollection::class.':'.ConfigDataType::class,
'type' => AsEnumCollection::class . ':' . ConfigDataType::class,
]);

$response = $this->laravelConfig->get($config->name);
Expand Down

0 comments on commit 11df5f6

Please sign in to comment.