Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 2987c09

Browse files
committed
Get rid of error suppression
- Thanks to intiilapa (Benoit Durand) - grep -r "@" library/Zend/ | grep -v "*" | grep -v "// @" used to identify suppressions - Used ErrorHandler to remove suppressions

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Pattern/CallbackCache.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Zend\Cache\Exception;
1414
use Zend\Cache\StorageFactory;
15+
use Zend\Stdlib\ErrorHandler;
1516

1617
/**
1718
* @category Zend
@@ -145,13 +146,16 @@ protected function generateCallbackKey($callback, array $args)
145146
$object = $callback[0];
146147
}
147148
if (isset($object)) {
149+
ErrorHandler::start();
148150
try {
149-
$serializedObject = @serialize($object);
151+
$serializedObject = serialize($object);
150152
} catch (\Exception $e) {
153+
ErrorHandler::stop();
151154
throw new Exception\RuntimeException(
152155
"Can't serialize callback: see previous exception", 0, $e
153156
);
154157
}
158+
ErrorHandler::stop();
155159

156160
if (!$serializedObject) {
157161
$lastErr = error_get_last();
@@ -178,13 +182,16 @@ protected function generateArgumentsKey(array $args)
178182
return '';
179183
}
180184

185+
ErrorHandler::start();
181186
try {
182-
$serializedArgs = @serialize(array_values($args));
187+
$serializedArgs = serialize(array_values($args));
183188
} catch (\Exception $e) {
189+
ErrorHandler::stop();
184190
throw new Exception\RuntimeException(
185191
"Can't serialize arguments: see previous exception"
186192
, 0, $e);
187193
}
194+
ErrorHandler::stop();
188195

189196
if (!$serializedArgs) {
190197
$lastErr = error_get_last();

0 commit comments

Comments
 (0)