mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-21 09:42:45 +01:00
correct undescore_names
This commit is contained in:
parent
da1bedb44b
commit
49679434e9
@ -68,7 +68,7 @@ final class VariableNaming
|
||||
|
||||
$paramName = $this->nodeNameResolver->getName($node);
|
||||
if ($paramName !== null) {
|
||||
return $paramName;
|
||||
return StaticRectorStrings::underscoreToPascalCase($paramName);
|
||||
}
|
||||
|
||||
if ($node instanceof String_) {
|
||||
|
@ -194,6 +194,7 @@ PHP
|
||||
$shortEventClassName = $this->classNaming->getVariableName($eventClassName);
|
||||
|
||||
$new = new New_(new FullyQualified($eventClassName));
|
||||
|
||||
if ($methodCall->args) {
|
||||
$new->args = $methodCall->args;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ final class SomeClass
|
||||
|
||||
public function __construct(EventManager $eventManager)
|
||||
{
|
||||
$this->eventManager = eventManager;
|
||||
$this->eventManager = $eventManager;
|
||||
}
|
||||
|
||||
public function run()
|
||||
@ -40,7 +40,7 @@ final class SomeClass
|
||||
|
||||
public function __construct(EventManager $eventManager)
|
||||
{
|
||||
$this->eventManager = eventManager;
|
||||
$this->eventManager = $eventManager;
|
||||
}
|
||||
|
||||
public function run()
|
||||
|
@ -8,9 +8,9 @@ final class DuplicatedEventParams
|
||||
{
|
||||
public $onUpload;
|
||||
|
||||
public function run(SomeUser $user)
|
||||
public function run(SomeUser $user, string $some_underscore)
|
||||
{
|
||||
$this->onUpload($user['owner_id'], $user['name']);
|
||||
$this->onUpload($user['owner_id'], $user['name'], $some_underscore);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,9 +32,9 @@ final class DuplicatedEventParams
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
public function run(SomeUser $user)
|
||||
public function run(SomeUser $user, string $some_underscore)
|
||||
{
|
||||
$duplicatedEventParamsUploadEvent = new \Rector\NetteKdyby\Tests\Rector\MethodCall\ReplaceMagicPropertyEventWithEventClassRector\Fixture\Event\DuplicatedEventParamsUploadEvent($user['owner_id'], $user['name']);
|
||||
$duplicatedEventParamsUploadEvent = new \Rector\NetteKdyby\Tests\Rector\MethodCall\ReplaceMagicPropertyEventWithEventClassRector\Fixture\Event\DuplicatedEventParamsUploadEvent($user['owner_id'], $user['name'], $some_underscore);
|
||||
$this->eventDispatcher->dispatch($duplicatedEventParamsUploadEvent);
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,15 @@ final class DuplicatedEventParamsUploadEvent extends \Symfony\Contracts\EventDis
|
||||
* @var mixed
|
||||
*/
|
||||
private $userName;
|
||||
public function __construct($userOwnerId, $userName)
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $someUnderscore;
|
||||
public function __construct($userOwnerId, $userName, string $someUnderscore)
|
||||
{
|
||||
$this->userOwnerId = $userOwnerId;
|
||||
$this->userName = $userName;
|
||||
$this->someUnderscore = $someUnderscore;
|
||||
}
|
||||
public function getUserOwnerId()
|
||||
{
|
||||
@ -25,4 +30,8 @@ final class DuplicatedEventParamsUploadEvent extends \Symfony\Contracts\EventDis
|
||||
{
|
||||
return $this->userName;
|
||||
}
|
||||
public function getSomeUnderscore(): string
|
||||
{
|
||||
return $this->someUnderscore;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user