Skip to content

Commit d5084b1

Browse files
committed
Revert "apply CallableThisArrayToAnonymousFunctionRector"
This reverts commit cd9fd6a.
1 parent cd9fd6a commit d5084b1

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

rector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
3030

3131
$parameters->set(Option::SKIP, [
32-
CallableThisArrayToAnonymousFunctionRector::class => [
33-
__DIR__ . '/spec',
34-
],
32+
CallableThisArrayToAnonymousFunctionRector::class,
3533
UnSpreadOperatorRector::class,
3634
]);
3735
};

src/HeroTrait.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ public function phpError(...$args): void
4949
ob_end_flush();
5050
}
5151

52-
ob_start(fn(string $buffer): string => $this->phpFatalErrorHandler($buffer));
52+
ob_start([$this, 'phpFatalErrorHandler']);
5353
register_shutdown_function([$this, 'execOnShutdown']);
54-
set_error_handler(function (int $errorType, string $errorMessage, string $errorFile, int $errorLine): void {
55-
$this->phpErrorHandler($errorType, $errorMessage, $errorFile, $errorLine);
56-
});
54+
set_error_handler([$this, 'phpErrorHandler']);
5755
}
5856

5957
private static function isUncaught(array $error): bool

src/Listener/Mvc.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,11 @@ public function attach(EventManagerInterface $events, $priority = 1): void
4343
}
4444

4545
// exceptions
46-
$this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, function (MvcEvent $e): void {
47-
$this->exceptionError($e);
48-
});
49-
$this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $e): void {
50-
$this->exceptionError($e);
51-
}, 100);
46+
$this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER_ERROR, [$this, 'exceptionError']);
47+
$this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, [$this, 'exceptionError'], 100);
5248

5349
// php errors
54-
$this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, function ($args): void {
55-
$this->phpError($args);
56-
});
50+
$this->listeners[] = $events->attach(MvcEvent::EVENT_BOOTSTRAP, [$this, 'phpError']);
5751
}
5852

5953
public function exceptionError(MvcEvent $e): void

src/Module.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ class Module
1717
public function init(ModuleManager $moduleManager): void
1818
{
1919
$eventManager = $moduleManager->getEventManager();
20-
$eventManager->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, function (ModuleEvent $event): void {
21-
$this->doctrineTransform($event);
22-
});
23-
$eventManager->attach(ModuleEvent::EVENT_MERGE_CONFIG, function (ModuleEvent $event): void {
24-
$this->errorPreviewPageHandler($event);
25-
}, 101);
20+
$eventManager->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'doctrineTransform']);
21+
$eventManager->attach(ModuleEvent::EVENT_MERGE_CONFIG, [$this, 'errorPreviewPageHandler'], 101);
2622
}
2723

2824
public function doctrineTransform(ModuleEvent $event): void

0 commit comments

Comments
 (0)