Skip to content

Commit 30b3280

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-95945: Add a code mess rule for improper session and cookies usages
1 parent 78b2b0e commit 30b3280

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/CookieAndSessionMisuse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ private function isControllerPlugin(\ReflectionClass $class): bool
7878
if (preg_match('/^(after|around|before).+/i', $method->getName())) {
7979
try {
8080
$argument = $method->getParameters()[0]->getClass();
81-
} catch (\ReflectionException $exception) {
82-
//Non-existing class (autogenerated perhaps)
81+
} catch (\Throwable $exception) {
82+
//Non-existing class (autogenerated perhaps) or doesn't have an argument.
8383
continue;
8484
}
8585
$isAction = $argument->isSubclassOf(\Magento\Framework\App\ActionInterface::class)
@@ -105,8 +105,8 @@ private function isBlockPlugin(\ReflectionClass $class): bool
105105
if (preg_match('/^(after|around|before).+/i', $method->getName())) {
106106
try {
107107
$argument = $method->getParameters()[0]->getClass();
108-
} catch (\ReflectionException $exception) {
109-
//Non-existing class (autogenerated perhaps)
108+
} catch (\Throwable $exception) {
109+
//Non-existing class (autogenerated perhaps) or doesn't have an argument.
110110
continue;
111111
}
112112
$isBlock = $argument->isSubclassOf(\Magento\Framework\View\Element\BlockInterface::class)

0 commit comments

Comments
 (0)