Skip to content

Commit

Permalink
[TASK] Rename Textrole to property textrole
Browse files Browse the repository at this point in the history
Do not let rector change regex, it has broken mine in the past
  • Loading branch information
linawolf committed Dec 18, 2023
1 parent 2f2b533 commit 9ea1372
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
Expand Down Expand Up @@ -31,6 +32,7 @@
]);
$config->skip([
PreferPHPUnitThisCallRector::class,
ChangeAndIfToEarlyReturnRector::class
ChangeAndIfToEarlyReturnRector::class,
SimplifyRegexPatternRector::class
]);
};
4 changes: 2 additions & 2 deletions resources/config/php-domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use T3Docs\GuidesPhpDomain\TextRoles\EnumTextRole;
use T3Docs\GuidesPhpDomain\TextRoles\ExceptionTextRole;
use T3Docs\GuidesPhpDomain\TextRoles\MethodTextRole;
use T3Docs\GuidesPhpDomain\TextRoles\ParameterTextRole;
use T3Docs\GuidesPhpDomain\TextRoles\PropertyTextRole;
use T3Docs\GuidesPhpDomain\TextRoles\TraitTextRole;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

Expand Down Expand Up @@ -79,7 +79,7 @@
->tag('phpdoc.guides.parser.rst.text_role', ['domain' => 'php'])
->set(MethodTextRole::class)
->tag('phpdoc.guides.parser.rst.text_role', ['domain' => 'php'])
->set(ParameterTextRole::class)
->set(PropertyTextRole::class)
->tag('phpdoc.guides.parser.rst.text_role', ['domain' => 'php'])
->set(TraitTextRole::class)
->tag('phpdoc.guides.parser.rst.text_role', ['domain' => 'php'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
use phpDocumentor\Guides\RestructuredText\TextRoles\TextRole;
use Psr\Log\LoggerInterface;

final class ParameterTextRole extends PhpComponentTextRole
final class PropertyTextRole extends PhpComponentTextRole
{
private const TYPE = 'property';

/**
* @see
* TYPO3\CMS\Core\Context\ContextAwareTrait::context
* @see https://regex101.com/r/Fj8X5Y/1
*/
private const PROPERTY_NAME_REGEX = '/^([a-zA-Z0-9_\\\\]+)\\:\\:\\$?([a-zA-Z0-9_]+)$/';
public function __construct(
Expand Down

0 comments on commit 9ea1372

Please sign in to comment.