Skip to content

Commit dea6ba5

Browse files
committed
MDVA-222: Port down MAGETWO-50611
1 parent b22198e commit dea6ba5

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

app/code/Magento/WebapiSecurity/Model/Plugin/CacheInvalidator.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,17 @@ public function __construct(\Magento\Framework\App\Cache\TypeListInterface $cach
2626
* Invalidate WebApi cache if needed.
2727
*
2828
* @param \Magento\Framework\App\Config\Value $subject
29-
* @param \Magento\Framework\App\Config\Value|null $result
30-
* @return \Magento\Framework\App\Config\Value|null
29+
* @return \Magento\Framework\App\Config\Value
3130
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3231
*/
33-
public function afterAfterSave(
34-
\Magento\Framework\App\Config\Value $subject,
35-
$result
36-
) {
37-
if (!is_null($result)) {
38-
if ($result->getPath() == \Magento\WebapiSecurity\Model\Plugin\AnonymousResourceSecurity::XML_ALLOW_INSECURE
39-
&& $result->isValueChanged()
40-
) {
41-
$this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Webapi::TYPE_IDENTIFIER);
42-
}
32+
public function afterAfterSave(\Magento\Framework\App\Config\Value $subject)
33+
{
34+
if ($subject->getPath() == \Magento\WebapiSecurity\Model\Plugin\AnonymousResourceSecurity::XML_ALLOW_INSECURE
35+
&& $subject->isValueChanged()
36+
) {
37+
$this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Webapi::TYPE_IDENTIFIER);
4338
}
4439

45-
return $result;
40+
return $subject;
4641
}
4742
}

0 commit comments

Comments
 (0)