Skip to content

Commit 32a7907

Browse files
Merge pull request #98 from TheDragonCode/4.x
The case of the properties of the properties from `snake_case` with `camelCase` is changed
2 parents 508026f + 0e2804a commit 32a7907

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Diff for: UPGRADE.md

+5
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ This means that the `DragonCode\Contracts\*` contracts will no longer be working
3636
### TTL Time Constants
3737

3838
Constants `DAY`, `MONTH` and `WEEK` was deleted from `DragonCode\Cache\Support\Ttl` class.
39+
40+
### Properties
41+
42+
1. The case of the properties of the properties from `snake_case` with `camelCase` is changed.
43+
2. The `hashing_key` property of `DragonCode\Cache\Services\Cache` class was renamed with `useHash`.

Diff for: src/Services/Cache.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Cache
3434

3535
protected bool $hashing_key = true;
3636

37-
protected string $key_hash = '';
37+
protected string $keyHash = '';
3838

3939
protected bool|object|string $when = true;
4040

@@ -51,9 +51,9 @@ public function when(bool|object|string $when = true): Cache
5151
return $this;
5252
}
5353

54-
public function ttl($value, bool $is_minutes = true): Cache
54+
public function ttl($value, bool $isMinutes = true): Cache
5555
{
56-
$this->ttl = $is_minutes
56+
$this->ttl = $isMinutes
5757
? Ttl::fromMinutes($value)
5858
: Ttl::fromSeconds($value);
5959

@@ -149,8 +149,8 @@ protected function manager(): CacheManager
149149

150150
protected function getKey(): string
151151
{
152-
if (! empty($this->key_hash)) {
153-
return $this->key_hash;
152+
if (! empty($this->keyHash)) {
153+
return $this->keyHash;
154154
}
155155

156156
$key = $this->key;

Diff for: src/Support/Ttl.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function fromSeconds($seconds): int
3030
return $this->get($seconds);
3131
}
3232

33-
public function fromDateTime(DateTimeInterface $date_time): int
33+
public function fromDateTime(DateTimeInterface $dateTime): int
3434
{
35-
$seconds = Carbon::now()->diffInSeconds($date_time);
35+
$seconds = Carbon::now()->diffInSeconds($dateTime);
3636

3737
return $this->correct($seconds);
3838
}

0 commit comments

Comments
 (0)