Skip to content

Commit 57e5e70

Browse files
authored
Mark data property in exceptions as api (#38)
1 parent dc502b5 commit 57e5e70

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

src/Generator/ExceptionClassGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ public function generate(ExceptionClassPlan $plan) : string
2222
yield '{';
2323
yield $generator->indent(function () use ($generator, $plan) {
2424
yield 'public function __construct(';
25-
yield $generator->indent('public readonly Data $data,');
25+
yield $generator->indent(function () use ($generator) {
26+
yield from $generator->docComment('@api');
27+
yield 'public readonly Data $data,';
28+
});
2629
yield ') {';
2730
yield $generator->indent(function () use ($generator, $plan) {
2831
yield 'parent::__construct(sprintf(';

tests/DumpOrThrows/Generated/Query/Test/TestQueryFailedException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
final class TestQueryFailedException extends Exception
1212
{
1313
public function __construct(
14+
/**
15+
* @api
16+
*/
1417
public readonly Data $data,
1518
) {
1619
parent::__construct(sprintf(

tests/IncludeAndSkipDirective/Generated/Query/Test/TestQueryFailedException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
final class TestQueryFailedException extends Exception
1212
{
1313
public function __construct(
14+
/**
15+
* @api
16+
*/
1417
public readonly Data $data,
1518
) {
1619
parent::__construct(sprintf(

tests/InlineProcessing/Generated/Query/ViewerProjects1d8480/ViewerProjectsQueryFailedException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
final class ViewerProjectsQueryFailedException extends Exception
1212
{
1313
public function __construct(
14+
/**
15+
* @api
16+
*/
1417
public readonly Data $data,
1518
) {
1619
parent::__construct(sprintf(

tests/Twig/Generated/Query/Projectsd4cba6/ProjectsQueryFailedException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
final class ProjectsQueryFailedException extends Exception
1212
{
1313
public function __construct(
14+
/**
15+
* @api
16+
*/
1417
public readonly Data $data,
1518
) {
1619
parent::__construct(sprintf(

0 commit comments

Comments
 (0)