1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Turbo;
4:
5: /**
6: * What a pcntl_fork()ed child needs from the turbo extension. With the
7: * extension active (TurboExtensionEnabler::isActive()), the native class
8: * replaces this one.
9: *
10: * @api
11: */
12: #[ShadowedByTurboExtension(implementation: __DIR__ . '/../../turbo-ext/src/ForkedChild.cpp')]
13: final class ForkedChild
14: {
15:
16: /**
17: * Ends the child with _exit() and the engine's exit status, skipping
18: * destructors and the module shutdown of every extension the child
19: * inherited - one waiting for threads the child never had wedges there.
20: * Register it as the child's last shutdown function.
21: *
22: * @return never
23: * @throws TurboNotActiveException
24: */
25: public static function exitImmediately()
26: {
27: throw new TurboNotActiveException();
28: }
29:
30: }
31: