---------- begin diff ----------
--- Original
+++ New
@@ -247,7 +247,9 @@
// Add a log message
$this->logger->debug(\Safe\sprintf('<success-nobg>(%s)</success-nobg> Object <success-nobg>%s</success-nobg> is of kind <success-nobg>%s</success-nobg>.', $displayPath, $objectKind, $type));
- set_error_handler([$this, '_HydrationErrorHandler']);
+ set_error_handler(function (int $errno, string $errstr) : void {
+ return $this->_HydrationErrorHandler($errno, $errstr);
+ });
// Hydrate the needed object
switch ($type) {
----------- end diff -----------
Applied rectors:
* Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector
The rector correctly transforms the use of the array into an anonymous function and correctly sets the return type hint.
But as thi method doesn't return anything, it should not add also the return value.
The function should be:
set_error_handler(function (int $errno, string $errstr) : void {
- return $this->_HydrationErrorHandler($errno, $errstr);
+ $this->_HydrationErrorHandler($errno, $errstr);
});
The rector correctly transforms the use of the array into an anonymous function and correctly sets the return type hint.
But as thi method doesn't return anything, it should not add also the return value.
The function should be:
set_error_handler(function (int $errno, string $errstr) : void { - return $this->_HydrationErrorHandler($errno, $errstr); + $this->_HydrationErrorHandler($errno, $errstr); });