Skip to content

Commit 2e99ab4

Browse files
committed
Convert Doctrine annotations from phpdoc-parser nodes, remove StaticDoctrineAnnotationParser
Amp-Thread-ID: https://ampcode.com/threads/T-01a17930-0285-73c5-a957-4325c77aa1b2
1 parent 6f8df55 commit 2e99ab4

26 files changed

Lines changed: 228 additions & 1305 deletions

File tree

‎phpstan.neon‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ parameters:
300300
message: '#Function "property_exists\(\)" cannot be used/left in the code#'
301301
paths:
302302
- src/NodeNameResolver/NodeNameResolver.php
303-
- src/BetterPhpDocParser/NodeDecorator/DoctrineAnnotationDecorator.php
304303

305304
-
306305
identifier: symplify.forbiddenFuncCall
@@ -361,8 +360,3 @@ parameters:
361360
paths:
362361
- tests/Issues/
363362
- tests/PhpParser/NodeTraverser/StopTraverseOnTypeChange/Class_
364-
365-
# known types
366-
-
367-
identifier: varTag.nativeType
368-
path: src/BetterPhpDocParser/PhpDocParser/StaticDoctrineAnnotationParser.php

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/keep_single_quoted.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/keep_single_quoted2.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/keep_single_quoted_key_value.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/multiline_content.php.inc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
2222
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation;
2323

2424
#[GenericAnnotation('
25-
summary: Send webcam reward
26-
')]
25+
* summary: Send webcam reward
26+
* ')]
2727
final class MultilineContent
2828
{
2929
}

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/nested_quote.php.inc‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
2323
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation;
2424

2525
#[GenericAnnotation('
26-
summary: key
27-
description: \'something `id => name`.\'
28-
')]
26+
* summary: key
27+
* description: \'something `id => name`.\'
28+
* ')]
2929
final class NestedQuote
3030
{
3131
}

‎rules-tests/Php80/Rector/Class_/AnnotationToAttributeRector/Fixture/nested_quoted_asterisk.php.inc‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
2525
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation;
2626

2727
#[GenericAnnotation('
28-
key: value
29-
another_key:
30-
another_value/*:
31-
schema: 100
32-
')]
28+
* key: value
29+
* another_key:
30+
* another_value/*:
31+
* schema: 100
32+
* ')]
3333
final class NestedQuote
3434
{
3535
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
4+
5+
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericAnnotation;
6+
7+
/**
8+
* @GenericAnnotation("sample", itemOperations='yes')
9+
*/
10+
final class SkipSingleQuotedKeyValue
11+
{
12+
}
13+
14+
?>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
4+
5+
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericSingleImplicitAnnotation;
6+
7+
/**
8+
* @GenericSingleImplicitAnnotation('/')
9+
*/
10+
final class SkipSingleQuotedValue
11+
{
12+
}
13+
14+
?>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Fixture;
4+
5+
use Rector\Tests\Php80\Rector\Class_\AnnotationToAttributeRector\Source\GenericSingleImplicitAnnotation;
6+
7+
/**
8+
* @GenericSingleImplicitAnnotation('"foo"')
9+
*/
10+
final class SkipSingleQuotedWithDoubleQuotes
11+
{
12+
}
13+
14+
?>

0 commit comments

Comments
 (0)