Skip to content

Commit

Permalink
Merge pull request #9 from sauls/v1.x
Browse files Browse the repository at this point in the history
v1.0.8
  • Loading branch information
sauls committed Aug 22, 2020
2 parents 99f5603 + 269cd0b commit 04b6ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Widgets/CacheableWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Contracts\Cache\CacheInterface;
use Symfony\Contracts\Cache\ItemInterface;

use function json_encode;
use function sprintf;

class CacheableWidget extends Widget implements Named
Expand Down Expand Up @@ -60,7 +61,7 @@ private function createKey(): string
return sprintf(
'__%1$s%2$s__%3$s__',
$this->getOption('namespace') . self::$prefix,
md5($this->getOption('widget.id')),
md5($this->getOption('widget.id') . json_encode($this->getOptions())),
$this->getId()
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/WidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function should_get_widget_cached_value(): void
CacheableWidget::$total = 0;
$cache = new ArrayAdapter();
$cache->get(
'____something_awesome__cw5d99926b83170885d513501ca045c9ba__cw0__',
'____something_awesome__cwefcdfdf79627baa3309f5be02cca8c0e__cw0__',
function (ItemInterface $item) {
return 'This is cached value for the widget';
}
Expand Down

0 comments on commit 04b6ef8

Please sign in to comment.