Skip to content

[Cache] Add PdoTagAwareAdapter #58296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: 7.4
Choose a base branch
from
Prev Previous commit
Next Next commit
CS
  • Loading branch information
Toflar committed Nov 25, 2024
commit a2b7817bf36c11317620f80a435536bdb85ae339
1 change: 0 additions & 1 deletion src/Symfony/Component/Cache/Adapter/PdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Cache\Adapter;

use Symfony\Component\Cache\Exception\InvalidArgumentException;
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Component\Cache\Traits\PdoTrait;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Cache/Adapter/PdoTagAwareAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Cache\Adapter;

use Symfony\Component\Cache\Exception\InvalidArgumentException;
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Component\Cache\Traits\PdoTrait;
Expand All @@ -22,6 +21,7 @@ class PdoTagAwareAdapter extends AbstractTagAwareAdapter implements PruneableInt
use PdoTrait {
doSave as public doSaveItem;
}

/**
* You can either pass an existing database connection as PDO instance or
* a DSN string that will be used to lazy-connect to the database when the
Expand Down Expand Up @@ -132,7 +132,7 @@ protected function doSave(array $values, int $lifetime, array $addTagData = [],

foreach ($addTagData as $tagId => $ids) {
foreach ($ids as $id) {
if (in_array($id, $failed, true)) {
if (\in_array($id, $failed, true)) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Cache\Tests\Adapter;

use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
use Symfony\Component\Cache\Adapter\PdoAdapter;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
namespace Symfony\Component\Cache\Tests\Adapter;

use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
use Symfony\Component\Cache\Adapter\PdoAdapter;
use Symfony\Component\Cache\Adapter\PdoTagAwareAdapter;

/**
Expand Down
5 changes: 0 additions & 5 deletions src/Symfony/Component/Cache/Traits/PdoTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
use Symfony\Component\Cache\Adapter\DoctrineDbalAdapter;
use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Contracts\Service\ResetInterface;

/**
* @internal
Expand Down Expand Up @@ -89,7 +87,6 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
return $pdo;
}


/**
* Creates the table to store cache items which can be called once for setup.
*
Expand Down Expand Up @@ -175,7 +172,6 @@ protected function doHave(string $id): bool
return (bool) $stmt->fetchColumn();
}


protected function doSave(array $values, int $lifetime): array|bool
{
if (!$values = $this->marshaller->marshall($values, $failed)) {
Expand Down Expand Up @@ -378,7 +374,6 @@ private function pruneExpiredItems(): bool
}
}


private function prepareStatementWithFallback(string $query, \Closure $createTable): \PDOStatement
{
$driver = $this->getDriver();
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy