Skip to content

Commit

Permalink
Rename variables to more descriptive versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrala committed Aug 22, 2023
1 parent d1234a8 commit 0ac14fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Rector/Deprecation/DrupalServiceRenameRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function refactor(Node $node) {
/* @var Node\Arg $argument */
$argument = $node->args[0];

if ($argument->value instanceof Node\Scalar\String_ && $argument->value->value === $configuration->getOldArgument()) {
$node->args[0] = new Node\Arg(new Node\Scalar\String_($configuration->getNewArgument()));
if ($argument->value instanceof Node\Scalar\String_ && $argument->value->value === $configuration->getDeprecatedService()) {
$node->args[0] = new Node\Arg(new Node\Scalar\String_($configuration->getNewService()));

return $node;
}
Expand Down
18 changes: 9 additions & 9 deletions src/Rector/ValueObject/DrupalServiceRenameConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
namespace DrupalRector\Rector\ValueObject;

class DrupalServiceRenameConfiguration {
protected string $newArgument;
protected string $newService;

protected string $oldArgument;
protected string $deprecatedService;

public function __construct(string $oldArgument, string $newArgument) {
$this->oldArgument = $oldArgument;
$this->newArgument = $newArgument;
public function __construct(string $deprecatedService, string $newService) {
$this->deprecatedService = $deprecatedService;
$this->newService = $newService;
}
public function getNewArgument(): string {
return $this->newArgument;
public function getNewService(): string {
return $this->newService;
}

public function getOldArgument(): string {
return $this->oldArgument;
public function getDeprecatedService(): string {
return $this->deprecatedService;
}

}

0 comments on commit 0ac14fa

Please sign in to comment.