Skip to content

Commit 2ef99f9

Browse files
committed
Convert around plugins to after plugins
We don't need to increase the callstack here with an around plugin, as the parameters we need to be able to access are provided to after plugins.
1 parent 46c09c6 commit 2ef99f9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lib/internal/Magento/Framework/App/Cache/FlushCacheByTags.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ public function __construct(
5454
*
5555
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5656
*/
57-
public function aroundSave(AbstractResource $subject, \Closure $proceed, AbstractModel $object): AbstractResource
58-
{
59-
$result = $proceed($object);
57+
public function afterSave(
58+
AbstractResource $subject,
59+
AbstractResource $result,
60+
AbstractModel $object
61+
): AbstractResource {
6062
$tags = $this->tagResolver->getTags($object);
6163
$this->cleanCacheByTags($tags);
6264

@@ -68,10 +70,12 @@ public function aroundSave(AbstractResource $subject, \Closure $proceed, Abstrac
6870
*
6971
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7072
*/
71-
public function aroundDelete(AbstractResource $subject, \Closure $proceed, AbstractModel $object): AbstractResource
72-
{
73+
public function afterDelete(
74+
AbstractResource $subject,
75+
AbstractResource $result,
76+
AbstractModel $object
77+
): AbstractResource {
7378
$tags = $this->tagResolver->getTags($object);
74-
$result = $proceed($object);
7579
$this->cleanCacheByTags($tags);
7680

7781
return $result;

0 commit comments

Comments
 (0)