Skip to content

Commit 205e8ee

Browse files
minor symfony#25619 Error handlers' $context should be optional as it's deprecated (nicolas-grekas)
This PR was merged into the 3.3 branch. Discussion ---------- Error handlers' $context should be optional as it's deprecated | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- f4fcbcd Error handlers' $context should be optional as it's deprecated
2 parents f6756ad + f4fcbcd commit 205e8ee

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function isFresh()
8282
$time = filemtime($this->file);
8383
$signalingException = new \UnexpectedValueException();
8484
$prevUnserializeHandler = ini_set('unserialize_callback_func', '');
85-
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) use (&$prevErrorHandler, $signalingException) {
85+
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$prevErrorHandler, $signalingException) {
8686
if (E_WARNING === $type && 'Class __PHP_Incomplete_Class has no unserializer' === $msg) {
8787
throw $signalingException;
8888
}

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function regenerate($destroy = false, $lifetime = null)
221221
public function save()
222222
{
223223
// Register custom error handler to catch a possible failure warning during session write
224-
set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {
224+
set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext = array()) {
225225
throw new ContextErrorException($errstr, $errno, E_WARNING, $errfile, $errline, $errcontext);
226226
}, E_WARNING);
227227

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value)
245245
/**
246246
* @internal
247247
*/
248-
public static function handleError($type, $message, $file, $line, $context)
248+
public static function handleError($type, $message, $file, $line, $context = array())
249249
{
250250
if (E_RECOVERABLE_ERROR === $type) {
251251
self::throwInvalidArgumentException($message, debug_backtrace(false), 1);

src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function setMaxString($maxString)
195195
*/
196196
public function cloneVar($var, $filter = 0)
197197
{
198-
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) {
198+
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) {
199199
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
200200
// Cloner never dies
201201
throw new \ErrorException($msg, 0, $type, $file, $line);

0 commit comments

Comments
 (0)