Skip to content

Commit

Permalink
Apply style.
Browse files Browse the repository at this point in the history
  • Loading branch information
YunusEmreNalbant committed Feb 29, 2024
1 parent 681020b commit 31524ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions src/LaravelConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getNested(string $namespace): Collection
}

/**
* @param $tags
* @param $tags
* @return Collection
*/
public function getByTag($tags): ?Collection
Expand Down Expand Up @@ -170,8 +170,8 @@ private function fillColumns(Config $config, ConfigItem $configItem): Config
/**
* Retrieves the value of the specified configuration key as a boolean.
*
* @param string $name
* @param $default
* @param string $name
* @param $default
* @return bool|null
*/
public function getValueAsBoolean(string $name, $default = null): ?bool
Expand All @@ -192,8 +192,8 @@ public function getValueAsBoolean(string $name, $default = null): ?bool
/**
* Retrieves the value of the specified configuration key as an integer.
*
* @param string $name
* @param mixed $default
* @param string $name
* @param mixed $default
* @return int|null
*/
public function getValueAsInt(string $name, $default = null): ?int
Expand All @@ -214,10 +214,10 @@ public function getValueAsInt(string $name, $default = null): ?int
/**
* Retrieves the value of the specified configuration key and decodes it from JSON to an array or an object.
*
* @param string $name
* @param mixed $default
* @param bool $associative
* @param int $depth
* @param string $name
* @param mixed $default
* @param bool $associative
* @param int $depth
* @return array
*/
public function getValueAsDecodeJson(string $name, $default = [], ?bool $associative = true, int $depth = 512): array
Expand All @@ -244,8 +244,8 @@ public function getValueAsDecodeJson(string $name, $default = [], ?bool $associa
/**
* Retrieves the value of the specified configuration key and converts it to a Carbon Date instance.
*
* @param string $name
* @param mixed $default
* @param string $name
* @param mixed $default
* @return Carbon|null
*/
public function getValueAsDate(string $name, $default = null): ?Carbon
Expand Down
28 changes: 14 additions & 14 deletions tests/LaravelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ public function it_returns_all_config_parameters(): void
public function it_returns_nested_config_parameters(): void
{
factory(Config::class)->create([
'name' => 'foo.bar',
'val' => true,
'name' => 'foo.bar',
'val' => true,
]);

factory(Config::class)->create([
'name' => 'foo.baz',
'val' => false,
'name' => 'foo.baz',
'val' => false,
]);

$response = $this->laravelConfig->getNested('foo');
Expand All @@ -212,13 +212,13 @@ public function it_returns_nested_config_parameters(): void
public function it_returns_value_as_boolean(): void
{
factory(Config::class)->create([
'name' => 'yunus.was.here',
'val' => "1",
'name' => 'yunus.was.here',
'val' => "1",
]);

factory(Config::class)->create([
'name' => 'foo.bar',
'val' => "0",
'name' => 'foo.bar',
'val' => "0",
]);

$this->assertTrue($this->laravelConfig->getValueAsBoolean('yunus.was.here'));
Expand All @@ -229,8 +229,8 @@ public function it_returns_value_as_boolean(): void
public function it_returns_value_as_int(): void
{
factory(Config::class)->create([
'name' => 'yunus.was.here',
'val' => "123456",
'name' => 'yunus.was.here',
'val' => "123456",
]);

$this->assertIsInt($this->laravelConfig->getValueAsInt('yunus.was.here'));
Expand All @@ -240,8 +240,8 @@ public function it_returns_value_as_int(): void
public function it_returns_value_as_decode_json(): void
{
factory(Config::class)->create([
'name' => 'yunus.was.here',
'val' => '{"9":[7,8,9],"2":[7,8,9],"31":[10,11,12]}'
'name' => 'yunus.was.here',
'val' => '{"9":[7,8,9],"2":[7,8,9],"31":[10,11,12]}'
]);

$response = $this->laravelConfig->getValueAsDecodeJson('yunus.was.here');
Expand All @@ -256,8 +256,8 @@ public function it_returns_value_as_decode_json(): void
public function it_returns_value_as_date(): void
{
factory(Config::class)->create([
'name' => 'yunus.was.here',
'val' => '2024-02-28 17:00'
'name' => 'yunus.was.here',
'val' => '2024-02-28 17:00'
]);

$response = $this->laravelConfig->getValueAsDate('yunus.was.here');
Expand Down

0 comments on commit 31524ec

Please sign in to comment.