1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Analyser;
4:
5: use PhpParser\Node;
6: use PHPStan\DependencyInjection\AutowiredService;
7:
8: /**
9: * @api
10: */
11: #[AutowiredService]
12: final class ScopeFactory
13: {
14:
15: public function __construct(
16: private InternalScopeFactoryFactory $internalScopeFactoryFactory,
17: )
18: {
19: }
20:
21: /**
22: * @param callable(Node $node, Scope $scope): void $nodeCallback
23: */
24: public function create(ScopeContext $context, ?callable $nodeCallback = null): MutatingScope
25: {
26: return $this->internalScopeFactoryFactory->create($nodeCallback)->create($context);
27: }
28:
29: }
30: