You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tracing/Cache/TraceableCacheAdapterTrait.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ public function get(string $key, callable $callback, float $beta = null, array &
71
71
{
72
72
return$this->traceFunction('cache.get_item', function () use ($key, $callback, $beta, &$metadata) {
73
73
if (!$this->decoratedAdapterinstanceof CacheInterface) {
74
-
thrownew \BadMethodCallException(sprintf('The %s() method is not supported on an adapter that does not implement the "%s" interface.', __FUNCTION__, CacheInterface::class));
74
+
thrownew \BadMethodCallException(sprintf('The %s::get() method is not supported because the decorated adapter does not implement the "%s" interface.', self::class, CacheInterface::class));
@@ -85,7 +85,7 @@ public function delete(string $key): bool
85
85
{
86
86
return$this->traceFunction('cache.delete_item', function () use ($key) {
87
87
if (!$this->decoratedAdapterinstanceof CacheInterface) {
88
-
thrownew \BadMethodCallException(sprintf('The %s() method is not supported on an adapter that does not implement the "%s" interface.', __FUNCTION__, CacheInterface::class));
88
+
thrownew \BadMethodCallException(sprintf('The %s::delete() method is not supported because the decorated adapter does not implement the "%s" interface.', self::class, CacheInterface::class));
89
89
}
90
90
91
91
return$this->decoratedAdapter->delete($key);
@@ -159,7 +159,7 @@ public function prune(): bool
159
159
{
160
160
return$this->traceFunction('cache.prune', function (): bool {
161
161
if (!$this->decoratedAdapterinstanceof PruneableInterface) {
162
-
thrownew \BadMethodCallException(sprintf('The %s() method is not supported on an adapter that does not implement the "%s" interface.', __FUNCTION__, PruneableInterface::class));
162
+
thrownew \BadMethodCallException(sprintf('The %s::prune() method is not supported because the decorated adapter does not implement the "%s" interface.', self::class, PruneableInterface::class));
163
163
}
164
164
165
165
return$this->decoratedAdapter->prune();
@@ -172,7 +172,7 @@ public function prune(): bool
172
172
publicfunctionreset(): void
173
173
{
174
174
if (!$this->decoratedAdapterinstanceof ResettableInterface) {
175
-
thrownew \BadMethodCallException(sprintf('The %s() method is not supported on an adapter that does not implement the "%s" interface.', __FUNCTION__, ResettableInterface::class));
175
+
thrownew \BadMethodCallException(sprintf('The %s::reset() method is not supported because the decorated adapter does not implement the "%s" interface.', self::class, ResettableInterface::class));
$this->expectExceptionMessage(sprintf('The %s::get() method is not supported because the decorated adapter does not implement the "Symfony\\Contracts\\Cache\\CacheInterface" interface.', \get_class($adapter)));
$this->expectExceptionMessage(sprintf('The %s::delete() method is not supported because the decorated adapter does not implement the "Symfony\\Contracts\\Cache\\CacheInterface" interface.', \get_class($adapter)));
$this->expectExceptionMessage(sprintf('The %s::prune() method is not supported because the decorated adapter does not implement the "Symfony\\Component\\Cache\\PruneableInterface" interface.', \get_class($adapter)));
$this->expectExceptionMessage(sprintf('The %s::reset() method is not supported because the decorated adapter does not implement the "Symfony\\Component\\Cache\\ResettableInterface" interface.', \get_class($adapter)));
0 commit comments