Skip to content

Commit 845aaff

Browse files
committed
storages: removed needless type conversion after 7da6cc6
1 parent b06f7b4 commit 845aaff

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
@@ -180,7 +180,7 @@ public function write($key, $data, array $dp)
180180
}
181181

182182
if (isset($dp[Cache::ITEMS])) {
183-
foreach ((array) $dp[Cache::ITEMS] as $item) {
183+
foreach ($dp[Cache::ITEMS] as $item) {
184184
$depFile = $this->getCacheFile($item);
185185
$m = $this->readMetaAndLock($depFile, LOCK_SH);
186186
$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
@@ -83,7 +83,7 @@ public function write($key, array $dependencies)
8383
if (!empty($dependencies[Cache::TAGS])) {
8484
$this->pdo->prepare('DELETE FROM tags WHERE key = ?')->execute([$key]);
8585

86-
foreach ((array) $dependencies[Cache::TAGS] as $tag) {
86+
foreach ($dependencies[Cache::TAGS] as $tag) {
8787
$arr[] = $key;
8888
$arr[] = $tag;
8989
}
@@ -123,7 +123,7 @@ public function clean(array $conditions)
123123

124124
$unions = $args = [];
125125
if (!empty($conditions[Cache::TAGS])) {
126-
$tags = (array) $conditions[Cache::TAGS];
126+
$tags = $conditions[Cache::TAGS];
127127
$unions[] = 'SELECT DISTINCT key FROM tags WHERE tag IN (?' . str_repeat(', ?', count($tags) - 1) . ')';
128128
$args = $tags;
129129
}

src/Caching/Storages/SQLiteStorage.php

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

123123
if (!empty($dependencies[Cache::TAGS])) {
124-
foreach ((array) $dependencies[Cache::TAGS] as $tag) {
124+
foreach ($dependencies[Cache::TAGS] as $tag) {
125125
$arr[] = $key;
126126
$arr[] = $tag;
127127
}
@@ -159,7 +159,7 @@ public function clean(array $conditions)
159159
$args = [time()];
160160

161161
if (!empty($conditions[Cache::TAGS])) {
162-
$tags = (array) $conditions[Cache::TAGS];
162+
$tags = $conditions[Cache::TAGS];
163163
$sql .= ' OR key IN (SELECT key FROM tags WHERE tag IN (?' . str_repeat(',?', count($tags) - 1) . '))';
164164
$args = array_merge($args, $tags);
165165
}

0 commit comments

Comments
 (0)