Skip to content

Commit 0714827

Browse files
authored
Remove getCacheKey() and getCacheTag() from Schema (#386)
1 parent a3ab423 commit 0714827

File tree

4 files changed

+2
-28
lines changed

4 files changed

+2
-28
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- Chg #382: Remove `yiisoft/json` dependency (@Tigrov)
3535
- Enh #384: Refactor according changes in `db` package (@Tigrov)
3636
- New #383: Add `caseSensitive` option to like condition (@vjik)
37+
- Enh #386: Remove `getCacheKey()` and `getCacheTag()` methods from `Schema` class (@Tigrov)
3738

3839
## 1.2.0 March 21, 2024
3940

src/DQLQueryBuilder.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Yiisoft\Db\Mysql\Builder\LikeConditionBuilder;
1212
use Yiisoft\Db\QueryBuilder\AbstractDQLQueryBuilder;
1313
use Yiisoft\Db\QueryBuilder\Condition\JsonOverlapsCondition;
14-
1514
use Yiisoft\Db\QueryBuilder\Condition\LikeCondition;
1615

1716
use function ctype_digit;

src/Schema.php

-26
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
use function in_array;
2626
use function is_string;
2727
use function ksort;
28-
use function md5;
2928
use function preg_match_all;
30-
use function serialize;
3129
use function str_contains;
3230
use function str_ireplace;
3331
use function str_starts_with;
@@ -327,30 +325,6 @@ protected function findViewNames(string $schema = ''): array
327325
return $views;
328326
}
329327

330-
/**
331-
* Returns the cache key for the specified table name.
332-
*
333-
* @param string $name The table name.
334-
*
335-
* @return array The cache key.
336-
*/
337-
protected function getCacheKey(string $name): array
338-
{
339-
return [self::class, ...$this->generateCacheKey(), $this->db->getQuoter()->getRawTableName($name)];
340-
}
341-
342-
/**
343-
* Returns the cache tag name.
344-
*
345-
* This allows {@see refresh()} to invalidate all cached table schemas.
346-
*
347-
* @return string The cache tag name.
348-
*/
349-
protected function getCacheTag(): string
350-
{
351-
return md5(serialize([self::class, ...$this->generateCacheKey()]));
352-
}
353-
354328
/**
355329
* Gets the `CREATE TABLE` SQL string.
356330
*

tests/DeadLockTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*/
4343
final class DeadLockTest extends TestCase
4444
{
45-
use testTrait;
45+
use TestTrait;
4646

4747
private const CHILD_EXIT_CODE_DEADLOCK = 15;
4848
private string $logFile = '';

0 commit comments

Comments
 (0)