Skip to content

Commit

Permalink
Merge branch 'master' into percs2
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Sep 8, 2023
2 parents c5b1691 + d0c9a72 commit 024a41f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ CHANGELOG for PHP CS Fixer

This file contains changelogs for stable releases only.

Changelog for v3.26.1
---------------------

* fix: Handle superfluous asterisk in `no_superfluous_phpdoc_tags` (#7279)

Changelog for v3.26.0
---------------------

Expand Down
2 changes: 1 addition & 1 deletion src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
final class Application extends BaseApplication
{
public const VERSION = '3.26.1-DEV';
public const VERSION = '3.26.2-DEV';
public const VERSION_CODENAME = 'Crank Cake';

private ToolInfo $toolInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/DocBlock/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private function getTypesContent(): ?string
}

$matchingResult = Preg::match(
'{^(?:\s*\*|/\*\*)\s*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
'{^(?:\s*\*|/\*\*)[\s\*]*@'.$name.'\s+'.TypeExpression::REGEX_TYPES.'(?:(?:[*\h\v]|\&?[\.\$]).*)?\r?$}is',
$this->lines[0]->getContent(),
$matches
);
Expand Down
21 changes: 21 additions & 0 deletions tests/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,27 @@ public function foo() {}
class Foo {
/** @return null */
public function foo() {}
}',
];

yield 'superfluous asterisk in corrupted phpDoc' => [
'<?php
class Foo {
/** * @return Baz */
public function doFoo($bar) {}
}',
];

yield 'superfluous return type after superfluous asterisk in corrupted phpDoc' => [
'<?php
class Foo {
/** */
public function doFoo($bar): Baz {}
}',
'<?php
class Foo {
/** * @return Baz */
public function doFoo($bar): Baz {}
}',
];
}
Expand Down

0 comments on commit 024a41f

Please sign in to comment.