Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ private function isClosedContent(string $composedContent): bool
Lexer::TOKEN_CLOSE_CURLY_BRACKET,
Lexer::TOKEN_CLOSE_PARENTHESES
// sometimes it gets mixed int ")
) || \str_contains($composedTokenIterator->currentTokenValue(), ')')) {
) || \str_contains($composedTokenIterator->currentTokenValue(), '}')
|| \str_contains($composedTokenIterator->currentTokenValue(), ')')) {
++$closeBracketCount;
}

Expand Down
27 changes: 27 additions & 0 deletions tests/Issues/InlineTags/Fixture/fixture.php.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use PHPUnit\Framework\TestCase;

/**
* @copyright Example {@link https://example.com}
* @covers \Tests\BarController
*/
class BarController extends TestCase
{
}

?>
-----
<?php

use PHPUnit\Framework\TestCase;

/**
* @copyright Example {@link https://example.com}
*/
#[\PHPUnit\Framework\Attributes\CoversClass(\Tests\BarController::class)]
class BarController extends TestCase
{
}

?>
28 changes: 28 additions & 0 deletions tests/Issues/InlineTags/InlineTagsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\Issues\InlineTagsTest;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

final class InlineTagsTest extends AbstractRectorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

public function provideConfigFilePath(): string
{
return __DIR__ . '/config/configured_rule.php';
}
}
9 changes: 9 additions & 0 deletions tests/Issues/InlineTags/config/configured_rule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_\CoversAnnotationWithValueToAttributeRector;

return RectorConfig::configure()
->withRules([CoversAnnotationWithValueToAttributeRector::class]);
Loading