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(private InternalScopeFactoryFactory $internalScopeFactoryFactory)
16: {
17: }
18:
19: /**
20: * @param callable(Node $node, Scope $scope): void $nodeCallback
21: */
22: public function create(ScopeContext $context, ?callable $nodeCallback = null): MutatingScope
23: {
24: return $this->internalScopeFactoryFactory->create($nodeCallback)->create($context);
25: }
26:
27: }
28: