Skip to content

Commit 12200db

Browse files
committed
storages: removed needless type conversion after 7da6cc6
1 parent d1ffc28 commit 12200db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Caching/Storages/FileStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function write(string $key, $data, array $dp): void
172172
}
173173

174174
if (isset($dp[Cache::ITEMS])) {
175-
foreach ((array) $dp[Cache::ITEMS] as $item) {
175+
foreach ($dp[Cache::ITEMS] as $item) {
176176
$depFile = $this->getCacheFile($item);
177177
$m = $this->readMetaAndLock($depFile, LOCK_SH);
178178
$meta[self::META_ITEMS][$depFile] = $m[self::META_TIME]; // may be NULL

src/Caching/Storages/SQLiteJournal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function write(string $key, array $dependencies): void
7777
if (!empty($dependencies[Cache::TAGS])) {
7878
$this->pdo->prepare('DELETE FROM tags WHERE key = ?')->execute([$key]);
7979

80-
foreach ((array) $dependencies[Cache::TAGS] as $tag) {
80+
foreach ($dependencies[Cache::TAGS] as $tag) {
8181
$arr[] = $key;
8282
$arr[] = $tag;
8383
}
@@ -116,7 +116,7 @@ public function clean(array $conditions): ?array
116116

117117
$unions = $args = [];
118118
if (!empty($conditions[Cache::TAGS])) {
119-
$tags = (array) $conditions[Cache::TAGS];
119+
$tags = $conditions[Cache::TAGS];
120120
$unions[] = 'SELECT DISTINCT key FROM tags WHERE tag IN (?' . str_repeat(', ?', count($tags) - 1) . ')';
121121
$args = $tags;
122122
}

src/Caching/Storages/SQLiteStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function write(string $key, $data, array $dependencies): void
114114
->execute([$key, serialize($data), $expire, $slide]);
115115

116116
if (!empty($dependencies[Cache::TAGS])) {
117-
foreach ((array) $dependencies[Cache::TAGS] as $tag) {
117+
foreach ($dependencies[Cache::TAGS] as $tag) {
118118
$arr[] = $key;
119119
$arr[] = $tag;
120120
}
@@ -148,7 +148,7 @@ public function clean(array $conditions): void
148148
$args = [time()];
149149

150150
if (!empty($conditions[Cache::TAGS])) {
151-
$tags = (array) $conditions[Cache::TAGS];
151+
$tags = $conditions[Cache::TAGS];
152152
$sql .= ' OR key IN (SELECT key FROM tags WHERE tag IN (?' . str_repeat(',?', count($tags) - 1) . '))';
153153
$args = array_merge($args, $tags);
154154
}

0 commit comments

Comments
 (0)