[CodingStyle] Skip RemoveDoubleUnderscoreInMethodNameRector when method name only __ (#4640)

This commit is contained in:
Abdul Malik Ikhsan 2020-11-18 16:57:50 +07:00 committed by GitHub
parent c58f35a41e
commit d788fd051a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -24,9 +24,9 @@ final class RemoveDoubleUnderscoreInMethodNameRector extends AbstractRector
{
/**
* @var string
* @see https://regex101.com/r/oRrhDJ/2
* @see https://regex101.com/r/oRrhDJ/3
*/
private const DOUBLE_UNDERSCORE_START_REGEX = '#^__(.*?)#';
private const DOUBLE_UNDERSCORE_START_REGEX = '#^__(.+)#';
public function getRuleDefinition(): RuleDefinition
{

View File

@ -0,0 +1,10 @@
<?php
namespace Rector\CodingStyle\Tests\Rector\ClassMethod\RemoveDoubleUnderscoreInMethodNameRector\Fixture;
class SkipMethodOnlyDoubleUnderscore
{
function __() {}
}
?>