Skip to content

Commit 83b625a

Browse files
committed
Add phpstan, psalm and phan aliases tests and fix a little more (remove unecessary comments)
1 parent 697b510 commit 83b625a

19 files changed

Lines changed: 141 additions & 204 deletions

libs/phpdoc/tests/DocBlock/Grammar/DescriptionGrammarRuleTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ public function readsThePlainTrailingText(): void
4848
self::assertSame('Some description text', (string) $description);
4949
}
5050

51-
/**
52-
* The description delegate resolves inline tags, so a `{@...}` becomes a
53-
* {@see TaggedDescription}.
54-
*/
5551
#[Test]
5652
public function keepsInlineTags(): void
5753
{
@@ -61,9 +57,6 @@ public function keepsInlineTags(): void
6157
self::assertSame('see {@link X}', (string) $description);
6258
}
6359

64-
/**
65-
* The whole remainder is consumed regardless of the whitespace it contains.
66-
*/
6760
#[Test]
6861
public function consumesTheEntireRemainder(): void
6962
{

libs/phpdoc/tests/DocBlock/Grammar/ReferenceGrammarRuleTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ protected function rule(): ReferenceCombinator
2525
}
2626

2727
/**
28-
* Each reference, mapped to the expected reference class and the string it
29-
* stringifies back to.
30-
*
3128
* @return iterable<string, array{string, class-string<ReferenceInterface>, string}>
3229
*/
3330
public static function referenceDataProvider(): iterable
@@ -64,9 +61,6 @@ public function classMethodExposesClassAndName(): void
6461
self::assertSame('foo', $reference->name);
6562
}
6663

67-
/**
68-
* Only the reference is consumed, the rest stays for the next rule.
69-
*/
7064
#[Test]
7165
public function stopsAtTheFirstWhitespace(): void
7266
{
@@ -78,10 +72,6 @@ public function stopsAtTheFirstWhitespace(): void
7872
self::assertSame(4, $cursor->offset);
7973
}
8074

81-
/**
82-
* A multi-part reference is consumed up to its last token, leaving the
83-
* trailing text untouched.
84-
*/
8575
#[Test]
8676
public function stopsAfterTheReference(): void
8777
{

libs/phpdoc/tests/DocBlock/Grammar/TypeGrammarRuleTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public function producesANamedType(): void
3131
self::assertSame('array', (string) $statement->type->name);
3232
}
3333

34-
/**
35-
* The parsed type keeps the exact text it was read from.
36-
*/
3734
#[Test]
3835
public function preservesTheSourceText(): void
3936
{
@@ -60,10 +57,6 @@ public function producesAUnionType(): void
6057
self::assertInstanceOf(UnionTypeNode::class, $statement->type);
6158
}
6259

63-
/**
64-
* Only the type is consumed, the trailing description stays for the next
65-
* rule.
66-
*/
6760
#[Test]
6861
public function stopsAfterTheType(): void
6962
{
@@ -75,10 +68,6 @@ public function stopsAfterTheType(): void
7568
self::assertSame(11, $cursor->offset);
7669
}
7770

78-
/**
79-
* The consumed offset is rebased onto the source when the cursor does not
80-
* start at zero.
81-
*/
8271
#[Test]
8372
public function respectsTheCursorBase(): void
8473
{

libs/phpdoc/tests/DocBlock/Grammar/VariableGrammarRuleTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public function returnsTheNameWithoutTheDollar(string $input, string $expected):
3636
self::assertSame($expected, $name);
3737
}
3838

39-
/**
40-
* Only the variable is consumed, the rest stays for the next rule.
41-
*/
4239
#[Test]
4340
public function stopsAtTheFirstWhitespace(): void
4441
{

libs/phpdoc/tests/DocBlock/Tag/ExampleTagTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ public function parsesLocationOnly(): void
6161
self::assertSame('@example demo.php', (string) $tag);
6262
}
6363

64-
/**
65-
* Any ordinary word is a valid relative URI, so a leading word is captured
66-
* as the location and the remainder becomes the description.
67-
*/
6864
#[Test]
6965
public function treatsLeadingWordAsLocation(): void
7066
{
@@ -77,10 +73,6 @@ public function treatsLeadingWordAsLocation(): void
7773
self::assertSame('@example demo.php the bundled snippet below.', (string) $tag);
7874
}
7975

80-
/**
81-
* A location is mandatory, so an input whose first word cannot be a URI is
82-
* malformed.
83-
*/
8476
#[Test]
8577
public function rejectsMissingLocation(): void
8678
{

libs/phpdoc/tests/DocBlock/Tag/LicenseTagTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ public function parsesUrlForm(): void
2828
self::assertSame('@license https://opensource.org/licenses/MIT MIT License', (string) $tag);
2929
}
3030

31-
/**
32-
* A word without a scheme is not a URL, so it is parsed as a named license.
33-
*/
3431
#[Test]
3532
public function parsesNameForm(): void
3633
{

libs/phpdoc/tests/DocBlock/Tag/MethodTagTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public function parsesLeadingReturnTypeAndStatic(): void
4747
self::assertSame('@method static ReturnType bar(U $u) An optional description.', (string) $tag);
4848
}
4949

50-
/**
51-
* A signature that is not a callable is malformed.
52-
*/
5350
#[Test]
5451
public function rejectsNonCallableSignature(): void
5552
{

libs/phpdoc/tests/DocBlock/Tag/ReferenceTagTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ public function usedByResolvesThroughTheRealParser(): void
4545
self::assertSame('used-by', $block->tags[0]->name);
4646
}
4747

48-
/**
49-
* Unlike "@see", the "@uses" tag references a code element only, so a URI
50-
* is not a valid target.
51-
*/
5248
#[Test]
5349
public function uriIsNotAccepted(): void
5450
{

libs/phpdoc/tests/DocBlock/Tag/TagTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
use TypeLang\PhpDoc\DocBlock\Tag\TagInterface;
1111
use TypeLang\PhpDoc\Tests\TestCase;
1212

13-
/**
14-
* Tests the behaviour shared by every tag through the abstract {@see Tag} base
15-
* class, exercised here via a minimal concrete subclass.
16-
*/
1713
final class TagTest extends TestCase
1814
{
1915
#[Test]

libs/phpdoc/tests/DocBlock/Tag/TemplateTagTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ public function parsesBoundWithoutDefault(): void
6161
self::assertNull($tag->default);
6262
}
6363

64-
/**
65-
* A word that merely starts with "of" is not the "of" keyword, so it stays
66-
* part of the description.
67-
*/
6864
#[Test]
6965
public function keywordRespectsWordBoundary(): void
7066
{

0 commit comments

Comments
 (0)