Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Adams <[email protected]>
  • Loading branch information
kjohnson and JasonTheAdams authored Aug 18, 2023
1 parent b7b418f commit 6e3fb02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/FormMigration/Actions/TransferDonations.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public function __construct($sourceId)
$this->sourceId = $sourceId;
}

public static function from($sourceId): TransferDonations
public static function from($sourceId): self
{
return new TransferDonations($sourceId);
}

public function to($destinationId)
public function to($destinationId): void
{
$this->__invoke($destinationId);
}
Expand Down
4 changes: 2 additions & 2 deletions src/FormMigration/Actions/TransferFormUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public function __construct($sourceId)
$this->sourceId = $sourceId;
}

public static function from($sourceId): TransferFormUrl
public static function from($sourceId): self
{
return new TransferFormUrl($sourceId);
}

public function to($destinationId)
public function to($destinationId): void
{
$this->__invoke($destinationId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function __construct(DonationFormV2 $formV2, DonationFormV3 $formV3)
$this->formV3 = $formV3;
}

public static function fromFormV2(DonationFormV2 $formV2): FormMigrationPayload
public static function fromFormV2(DonationFormV2 $formV2): self
{
return new FormMigrationPayload($formV2, DonationFormV3::factory()->create());
return new self($formV2, DonationFormV3::factory()->create());
}
}
8 changes: 4 additions & 4 deletions src/FormMigration/DataTransferObjects/TransferOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ public function __construct(bool $changeUrl, bool $delete, bool $redirect)
$this->redirect = $redirect;
}

public static function fromRequest(WP_REST_Request $request): TransferOptions
public static function fromRequest(WP_REST_Request $request): self
{
return new TransferOptions(
return new self(
$request->get_param('changeUrl'),
$request->get_param('delete'),
$request->get_param('redirect')
);
}

public static function fromArray($options): TransferOptions
public static function fromArray($options): self
{
return new TransferOptions(
return new self(
$options['changeUrl'],
$options['delete'],
$options['redirect']
Expand Down

0 comments on commit 6e3fb02

Please sign in to comment.