diff --git a/README.md b/README.md index 1497e28..5044b72 100644 --- a/README.md +++ b/README.md @@ -381,6 +381,12 @@ enum SearchType: string // Returns results matching issues in repositories. case IssueAdvanced = 'ISSUE_ADVANCED'; + // Returns results matching issues using hybrid (lexical + semantic) search. + case IssueHybrid = 'ISSUE_HYBRID'; + + // Returns results matching issues using semantic search. + case IssueSemantic = 'ISSUE_SEMANTIC'; + // Returns results matching repositories. case Repository = 'REPOSITORY'; diff --git a/composer.json b/composer.json index 96ce770..63582e0 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "php": "^8.4", "composer-runtime-api": "^2.0", "nikic/php-parser": "^5.6", - "phpstan/phpstan": "^2.1", + "phpstan/phpstan": "^2.1.18", "ruudk/code-generator": "^0.4.4", "symfony/console": "^7.4 || ^8.0", "symfony/filesystem": "^7.4 || ^8.0", diff --git a/composer.lock b/composer.lock index 3dea6c5..70a0b05 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8931a5072831ee21eca3977eabcb5b38", + "content-hash": "32a5a30a91518fe6d8f9e12ffc3ff908", "packages": [ { "name": "nikic/php-parser", @@ -66,16 +66,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.22", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4" - }, + "version": "2.1.49", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/41600c8379eb5aee63e9413fe9e97273e25d57e4", - "reference": "41600c8379eb5aee63e9413fe9e97273e25d57e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d0082955396e7f5ba19cf298224b85e1099f0ed8", + "reference": "d0082955396e7f5ba19cf298224b85e1099f0ed8", "shasum": "" }, "require": { @@ -120,7 +115,7 @@ "type": "github" } ], - "time": "2025-08-04T19:17:37+00:00" + "time": "2026-04-16T21:10:58+00:00" }, { "name": "psr/container", diff --git a/examples/Generated/Enum/SearchType.php b/examples/Generated/Enum/SearchType.php index 9bd3169..97e06af 100644 --- a/examples/Generated/Enum/SearchType.php +++ b/examples/Generated/Enum/SearchType.php @@ -20,6 +20,12 @@ enum SearchType: string // Returns results matching issues in repositories. case IssueAdvanced = 'ISSUE_ADVANCED'; + // Returns results matching issues using hybrid (lexical + semantic) search. + case IssueHybrid = 'ISSUE_HYBRID'; + + // Returns results matching issues using semantic search. + case IssueSemantic = 'ISSUE_SEMANTIC'; + // Returns results matching repositories. case Repository = 'REPOSITORY'; diff --git a/lefthook.yaml b/lefthook.yaml index a999a78..646532a 100644 --- a/lefthook.yaml +++ b/lefthook.yaml @@ -32,6 +32,8 @@ pre-commit: php-cs-fixer: glob: "*.php" + exclude: + - "**/Generated/**" run: vendor/bin/php-cs-fixer fix --config .php-cs-fixer.php -- {staged_files} stage_fixed: true diff --git a/phpstan.php b/phpstan.php index 9678455..302faaa 100644 --- a/phpstan.php +++ b/phpstan.php @@ -61,6 +61,14 @@ __DIR__ . '/tests/*/Generated/*', ], ], + [ + 'identifiers' => [ + 'shipmonk.deadMethod', + ], + 'paths' => [ + __DIR__ . '/tests/PHPStan/Fixtures/*', + ], + ], [ 'identifiers' => [ 'shipmonk.deadConstant', diff --git a/src/Generator/DataClassGenerator.php b/src/Generator/DataClassGenerator.php index 1a0afb5..3c6aff1 100644 --- a/src/Generator/DataClassGenerator.php +++ b/src/Generator/DataClassGenerator.php @@ -12,7 +12,8 @@ use Ruudk\GraphQLCodeGenerator\Config\Config; use Ruudk\GraphQLCodeGenerator\GraphQL\AST\Printer; use Ruudk\GraphQLCodeGenerator\Planner\Plan\DataClassPlan; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; use Ruudk\GraphQLCodeGenerator\Type\FragmentObjectType; use Ruudk\GraphQLCodeGenerator\Type\IndexByCollectionType; use Ruudk\GraphQLCodeGenerator\Type\StringLiteralType; @@ -86,12 +87,20 @@ public function generate(DataClassPlan $plan) : string if ($this->config->addGeneratedAttribute) { yield from $generator->dumpAttribute(Generated::class, function () use ($generator, $plan) { - if ($plan->source instanceof FileSource) { + if ($plan->source instanceof GraphQLFileSource) { yield sprintf('source: %s', var_export($plan->source->relativeFilePath, true)); return; } + if ($plan->source instanceof TwigFileSource) { + yield sprintf('source: %s', var_export($plan->source->relativeFilePath, true)); + yield 'restricted: true'; + yield 'restrictInstantiation: true'; + + return; + } + yield sprintf('source: %s', $generator->dumpClassReference($plan->source->class)); yield 'restricted: true'; yield 'restrictInstantiation: true'; diff --git a/src/Generator/OperationClassGenerator.php b/src/Generator/OperationClassGenerator.php index 44c9749..2acfa88 100644 --- a/src/Generator/OperationClassGenerator.php +++ b/src/Generator/OperationClassGenerator.php @@ -8,7 +8,7 @@ use Ruudk\CodeGenerator\CodeGenerator; use Ruudk\GraphQLCodeGenerator\Attribute\Generated; use Ruudk\GraphQLCodeGenerator\Planner\Plan\OperationClassPlan; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Type\TypeDumper; use Symfony\Component\TypeInfo\Type as SymfonyType; use Symfony\Component\TypeInfo\TypeIdentifier; @@ -36,7 +36,7 @@ public function generate(OperationClassPlan $plan) : string if ($this->config->addGeneratedAttribute) { yield from $generator->dumpAttribute(Generated::class, function () use ($generator, $plan) { - if ($plan->source instanceof FileSource) { + if ($plan->source instanceof GraphQLFileSource) { yield sprintf('source: %s', var_export($plan->source->relativeFilePath, true)); return; diff --git a/src/GraphQL/DocumentNodeWithSource.php b/src/GraphQL/DocumentNodeWithSource.php index ebedd1c..55eaa80 100644 --- a/src/GraphQL/DocumentNodeWithSource.php +++ b/src/GraphQL/DocumentNodeWithSource.php @@ -7,14 +7,15 @@ use GraphQL\Language\AST\DocumentNode; use GraphQL\Language\AST\FragmentDefinitionNode; use GraphQL\Language\AST\NodeList; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; final class DocumentNodeWithSource extends DocumentNode { - public FileSource | InlineSource $source; + public GraphQLFileSource | InlineSource | TwigFileSource $source; - public static function create(DocumentNode $documentNode, FileSource | InlineSource $source) : self + public static function create(DocumentNode $documentNode, GraphQLFileSource | InlineSource | TwigFileSource $source) : self { $definitions = []; foreach ($documentNode->definitions as $definition) { diff --git a/src/GraphQL/FragmentDefinitionNodeWithSource.php b/src/GraphQL/FragmentDefinitionNodeWithSource.php index 32ae8f6..1eda5ba 100644 --- a/src/GraphQL/FragmentDefinitionNodeWithSource.php +++ b/src/GraphQL/FragmentDefinitionNodeWithSource.php @@ -5,14 +5,15 @@ namespace Ruudk\GraphQLCodeGenerator\GraphQL; use GraphQL\Language\AST\FragmentDefinitionNode; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; final class FragmentDefinitionNodeWithSource extends FragmentDefinitionNode { - public FileSource | InlineSource $source; + public GraphQLFileSource | InlineSource | TwigFileSource $source; - public static function create(FragmentDefinitionNode $fragmentNode, FileSource | InlineSource $source) : self + public static function create(FragmentDefinitionNode $fragmentNode, GraphQLFileSource | InlineSource | TwigFileSource $source) : self { return new self([ 'name' => $fragmentNode->name, diff --git a/src/PHP/Visitor/OperationFinder.php b/src/PHP/Visitor/OperationFinder.php index 55b30c5..70f7587 100644 --- a/src/PHP/Visitor/OperationFinder.php +++ b/src/PHP/Visitor/OperationFinder.php @@ -42,6 +42,10 @@ public function enterNode(Node $node) : null return null; } + if ($this->className === null) { + return null; + } + foreach ($node->params as $param) { if ( ! $param->var instanceof Node\Expr\Variable) { continue; diff --git a/src/Planner.php b/src/Planner.php index 35e4012..8cc2630 100644 --- a/src/Planner.php +++ b/src/Planner.php @@ -76,8 +76,9 @@ use Ruudk\GraphQLCodeGenerator\Planner\Plan\OperationClassPlan; use Ruudk\GraphQLCodeGenerator\Planner\PlannerResult; use Ruudk\GraphQLCodeGenerator\Planner\SelectionSetPlanner; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; use Ruudk\GraphQLCodeGenerator\Twig\GraphQLExtension; use Ruudk\GraphQLCodeGenerator\Twig\GraphQLNodeFinder; use Ruudk\GraphQLCodeGenerator\Type\TypeHelper; @@ -252,7 +253,7 @@ public function plan() : PlannerResult $operations[$file->getPathname()][] = DocumentNodeWithSource::create( $document, - new FileSource(Path::makeRelative($file->getPathname(), $this->config->projectDir)), + new GraphQLFileSource(Path::makeRelative($file->getPathname(), $this->config->projectDir)), ); } @@ -344,7 +345,7 @@ public function plan() : PlannerResult $operations[$file->getPathname()][] = DocumentNodeWithSource::create( $document, - new FileSource(Path::makeRelative($file->getPathname(), $this->config->projectDir)), + new TwigFileSource(Path::makeRelative($file->getPathname(), $this->config->projectDir)), ); } } @@ -615,14 +616,20 @@ private function planOperation(DocumentNodeWithSource $document, string $path, P Assert::notNull($operation->name, 'Expected operation to have a name'); + if ($document->source instanceof TwigFileSource) { + throw new Exception('Twig templates may only contain fragment definitions'); + } + + $source = $document->source; + $operationName = $operation->name->value; $operationNamespaceName = $operationName; - if ($document->source instanceof InlineSource) { + if ($source instanceof InlineSource) { $operationNamespaceName = sprintf( '%s%s', $operationName, - $document->source->hash, + $source->hash, ); } @@ -650,7 +657,7 @@ private function planOperation(DocumentNodeWithSource $document, string $path, P // Plan the data class and its nested classes $planResult = $planner->plan( - $document->source, + $source, $operation->selectionSet, $rootType, $operationDir . '/Data', @@ -660,7 +667,7 @@ private function planOperation(DocumentNodeWithSource $document, string $path, P // Create the data class plan $dataClassPlan = new DataClassPlan( - $document->source, + $source, $operationDir . '/Data.php', $fqcn, $rootType, @@ -684,7 +691,7 @@ private function planOperation(DocumentNodeWithSource $document, string $path, P $operationType, $operationDefinition, $variables, - $document->source, + $source, ); // Create the error class plan diff --git a/src/Planner/Plan/DataClassPlan.php b/src/Planner/Plan/DataClassPlan.php index ec15eca..dda55cd 100644 --- a/src/Planner/Plan/DataClassPlan.php +++ b/src/Planner/Plan/DataClassPlan.php @@ -9,8 +9,9 @@ use GraphQL\Language\AST\OperationDefinitionNode; use GraphQL\Type\Definition\NamedType; use GraphQL\Type\Definition\Type; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; use Symfony\Component\TypeInfo\Type as SymfonyType; final readonly class DataClassPlan @@ -20,7 +21,7 @@ * @param array> $inlineFragmentRequiredFields */ public function __construct( - public FileSource | InlineSource $source, + public GraphQLFileSource | InlineSource | TwigFileSource $source, public string $path, public string $fqcn, public NamedType & Type $parentType, diff --git a/src/Planner/Plan/OperationClassPlan.php b/src/Planner/Plan/OperationClassPlan.php index 401fb22..748f647 100644 --- a/src/Planner/Plan/OperationClassPlan.php +++ b/src/Planner/Plan/OperationClassPlan.php @@ -4,7 +4,7 @@ namespace Ruudk\GraphQLCodeGenerator\Planner\Plan; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; use Symfony\Component\TypeInfo\Type as SymfonyType; @@ -21,6 +21,6 @@ public function __construct( public string $operationType, public string $operationDefinition, public array $variables, - public FileSource | InlineSource $source, + public GraphQLFileSource | InlineSource $source, ) {} } diff --git a/src/Planner/SelectionSetPlanner.php b/src/Planner/SelectionSetPlanner.php index aba33b4..4ceb061 100644 --- a/src/Planner/SelectionSetPlanner.php +++ b/src/Planner/SelectionSetPlanner.php @@ -30,8 +30,9 @@ use Ruudk\GraphQLCodeGenerator\GraphQL\FragmentDefinitionNodeWithSource; use Ruudk\GraphQLCodeGenerator\GraphQL\PossibleTypesFinder; use Ruudk\GraphQLCodeGenerator\Planner\Plan\DataClassPlan; -use Ruudk\GraphQLCodeGenerator\Planner\Source\FileSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\GraphQLFileSource; use Ruudk\GraphQLCodeGenerator\Planner\Source\InlineSource; +use Ruudk\GraphQLCodeGenerator\Planner\Source\TwigFileSource; use Ruudk\GraphQLCodeGenerator\RecursiveTypeFinder; use Ruudk\GraphQLCodeGenerator\Type\FragmentObjectType; use Ruudk\GraphQLCodeGenerator\Type\IndexByCollectionType; @@ -93,7 +94,7 @@ public function __construct( * @throws LogicException */ public function plan( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, SelectionSetNode $selectionSet, Type $parent, string $outputDirectory, @@ -150,7 +151,7 @@ public function plan( * @throws LogicException */ public function planSelectionSet( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, SelectionSetNode $selectionSet, Type $type, PlanningContext $context, @@ -228,7 +229,7 @@ public function planSelectionSet( * @throws LogicException */ private function planNamedTypeSelectionSet( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, SelectionSetNode $selectionSet, NamedType & Type $type, PlanningContext $context, @@ -324,7 +325,7 @@ private function planNamedTypeSelectionSet( * @throws LogicException */ private function processFieldSelection( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, FieldNode $selection, Type $parent, PlanningContext $context, @@ -401,7 +402,7 @@ private function processFieldSelection( * @throws LogicException */ private function processNestedSelection( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, FieldNode $selection, string $fieldName, Type $fieldType, @@ -474,7 +475,7 @@ private function processNestedSelection( * @throws LogicException */ private function processInlineFragment( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, InlineFragmentNode $selection, Type $parent, PlanningContext $context, @@ -729,9 +730,7 @@ private function processFragmentSpread( } // Merge path fields from fragment - if (isset($fragmentResult->pathFields)) { - $pathFields->merge($fragmentResult->pathFields); - } + $pathFields->merge($fragmentResult->pathFields); } // Note: PayloadShapeBuilder already handles merging fields from fragment spreads @@ -1030,7 +1029,7 @@ private function extractNodesType( * @throws InvariantViolation */ private function createDataClassPlan( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, NamedType & Type $parentType, SelectionSetResult $result, PlanningContext $context, @@ -1076,7 +1075,7 @@ private function createDataClassPlan( } private function createInlineFragmentClassPlan( - FileSource | InlineSource $source, + GraphQLFileSource | InlineSource | TwigFileSource $source, NamedType & Type $fragmentType, FieldCollection $fields, PayloadShape $payloadShape, diff --git a/src/Planner/Source/GraphQLFileSource.php b/src/Planner/Source/GraphQLFileSource.php new file mode 100644 index 0000000..117d84f --- /dev/null +++ b/src/Planner/Source/GraphQLFileSource.php @@ -0,0 +1,12 @@ +initializers = array_combine( - array_map(fn(TypeInitializer $initializer) => $initializer::class, $initializers), - $initializers, - ); + $indexed = []; + + foreach ($initializers as $initializer) { + $indexed[$initializer::class] = $initializer; + } + + $this->initializers = $indexed; } /** diff --git a/tests/GraphQLTestCase.php b/tests/GraphQLTestCase.php index 04c593f..9d737dc 100644 --- a/tests/GraphQLTestCase.php +++ b/tests/GraphQLTestCase.php @@ -29,7 +29,9 @@ protected function setUp() : void $parts = explode('\\', static::class); array_pop($parts); $this->namespace = implode('\\', $parts); - $this->directory = __DIR__ . '/' . $parts[array_key_last($parts)]; + $directoryName = end($parts); + Assert::string($directoryName); + $this->directory = __DIR__ . '/' . $directoryName; $this->client = new Client(); } diff --git a/tests/PHPStan/Fixtures/AllowedController.php b/tests/PHPStan/Fixtures/AllowedController.php new file mode 100644 index 0000000..c70a01d --- /dev/null +++ b/tests/PHPStan/Fixtures/AllowedController.php @@ -0,0 +1,23 @@ +execute(); + $inline = new Data('inline'); + + return $data->name . $inline->name; + } +} diff --git a/tests/PHPStan/Fixtures/NotAllowedController.php b/tests/PHPStan/Fixtures/NotAllowedController.php new file mode 100644 index 0000000..1a99eb9 --- /dev/null +++ b/tests/PHPStan/Fixtures/NotAllowedController.php @@ -0,0 +1,23 @@ +execute(); + $inline = new Data('inline'); + + return $data->name . $inline->name; + } +} diff --git a/tests/PHPStan/Generated/Data.php b/tests/PHPStan/Generated/Data.php new file mode 100644 index 0000000..dfa1f2b --- /dev/null +++ b/tests/PHPStan/Generated/Data.php @@ -0,0 +1,21 @@ +name); + } +} diff --git a/tests/PHPStan/RestrictedUsageExtensionTest.php b/tests/PHPStan/RestrictedUsageExtensionTest.php new file mode 100644 index 0000000..71008aa --- /dev/null +++ b/tests/PHPStan/RestrictedUsageExtensionTest.php @@ -0,0 +1,28 @@ +&1', + escapeshellarg(dirname(__DIR__, 2) . '/vendor/bin/phpstan'), + escapeshellarg(__DIR__ . '/phpstan.neon'), + ); + + exec($command, $output, $exitCode); + + self::assertSame(0, $exitCode, sprintf( + "PHPStan reported errors for tests/PHPStan fixtures.\n\nOutput:\n%s", + implode(PHP_EOL, $output), + )); + } +} diff --git a/tests/PHPStan/config.php b/tests/PHPStan/config.php new file mode 100644 index 0000000..56c9160 --- /dev/null +++ b/tests/PHPStan/config.php @@ -0,0 +1,14 @@ +plan( - new FileSource(''), + new GraphQLFileSource(''), $itemFragment->selectionSet, $itemType, '/tmp/generated/Fragment/ItemWithDetails', @@ -162,7 +162,7 @@ public function testNestedFragmentPayloadShapeMerging() : void } } '); - $document = DocumentNodeWithSource::create($document, new FileSource('')); + $document = DocumentNodeWithSource::create($document, new GraphQLFileSource('')); // Collect fragments $fragments = []; $fragmentTypes = []; @@ -223,7 +223,7 @@ public function testNestedFragmentPayloadShapeMerging() : void $paymentFragment = $fragments['PaymentDetails']; $paymentType = $fragmentTypes['PaymentDetails']; $planner->plan( - new FileSource(''), + new GraphQLFileSource(''), $paymentFragment->selectionSet, $paymentType, '/tmp/generated/Fragment/PaymentDetails', diff --git a/tests/Twig/Generated/Fragment/AdminProjectList.php b/tests/Twig/Generated/Fragment/AdminProjectList.php index fdf1db6..2fb442e 100644 --- a/tests/Twig/Generated/Fragment/AdminProjectList.php +++ b/tests/Twig/Generated/Fragment/AdminProjectList.php @@ -10,7 +10,11 @@ // This file was automatically generated and should not be edited. -#[Generated(source: 'tests/Twig/templates/list.html.twig')] +#[Generated( + source: 'tests/Twig/templates/list.html.twig', + restricted: true, + restrictInstantiation: true, +)] final class AdminProjectList { /** diff --git a/tests/Twig/Generated/Fragment/AdminProjectList/Project.php b/tests/Twig/Generated/Fragment/AdminProjectList/Project.php index 217c411..d7238bd 100644 --- a/tests/Twig/Generated/Fragment/AdminProjectList/Project.php +++ b/tests/Twig/Generated/Fragment/AdminProjectList/Project.php @@ -9,7 +9,11 @@ // This file was automatically generated and should not be edited. -#[Generated(source: 'tests/Twig/templates/list.html.twig')] +#[Generated( + source: 'tests/Twig/templates/list.html.twig', + restricted: true, + restrictInstantiation: true, +)] final class Project { public AdminProjectRow $adminProjectRow { diff --git a/tests/Twig/Generated/Fragment/AdminProjectList/Viewer.php b/tests/Twig/Generated/Fragment/AdminProjectList/Viewer.php index 8efe9fc..137015f 100644 --- a/tests/Twig/Generated/Fragment/AdminProjectList/Viewer.php +++ b/tests/Twig/Generated/Fragment/AdminProjectList/Viewer.php @@ -8,7 +8,11 @@ // This file was automatically generated and should not be edited. -#[Generated(source: 'tests/Twig/templates/list.html.twig')] +#[Generated( + source: 'tests/Twig/templates/list.html.twig', + restricted: true, + restrictInstantiation: true, +)] final class Viewer { /** diff --git a/tests/Twig/Generated/Fragment/AdminProjectOptions.php b/tests/Twig/Generated/Fragment/AdminProjectOptions.php index df2c837..eb1c910 100644 --- a/tests/Twig/Generated/Fragment/AdminProjectOptions.php +++ b/tests/Twig/Generated/Fragment/AdminProjectOptions.php @@ -10,7 +10,11 @@ // This file was automatically generated and should not be edited. -#[Generated(source: 'tests/Twig/templates/_project_options.html.twig')] +#[Generated( + source: 'tests/Twig/templates/_project_options.html.twig', + restricted: true, + restrictInstantiation: true, +)] final class AdminProjectOptions { public ?ProjectState $state { diff --git a/tests/Twig/Generated/Fragment/AdminProjectRow.php b/tests/Twig/Generated/Fragment/AdminProjectRow.php index 43221a4..90a5995 100644 --- a/tests/Twig/Generated/Fragment/AdminProjectRow.php +++ b/tests/Twig/Generated/Fragment/AdminProjectRow.php @@ -9,7 +9,11 @@ // This file was automatically generated and should not be edited. -#[Generated(source: 'tests/Twig/templates/_project_row.html.twig')] +#[Generated( + source: 'tests/Twig/templates/_project_row.html.twig', + restricted: true, + restrictInstantiation: true, +)] final class AdminProjectRow { public AdminProjectOptions $adminProjectOptions {