Skip to content

Commit

Permalink
chore: Update return self signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
kjohnson committed Aug 18, 2023
1 parent dcfe606 commit b7b418f
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AuthenticationData
*
* @since 3.0.0
*/
public static function fromRequest(array $request): AuthenticationData
public static function fromRequest(array $request): self
{
$self = new self();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DonateFormRouteData implements Arrayable
*
* @since 3.0.0
*/
public static function fromRequest(array $requestData): DonateFormRouteData
public static function fromRequest(array $requestData): self
{
$self = new self();
$self->formId = (int)$requestData['formId'];
Expand Down
2 changes: 1 addition & 1 deletion src/DonationForms/DataTransferObjects/DonateRouteData.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DonateRouteData
*
* @since 3.0.0
*/
public static function fromRequest(array $request): DonateRouteData
public static function fromRequest(array $request): self
{
$self = new self();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class DonationConfirmationReceiptViewRouteData
*
* @since 3.0.0
*/
public static function fromRequest(array $request): DonationConfirmationReceiptViewRouteData
public static function fromRequest(array $request): self
{
$self = new DonationConfirmationReceiptViewRouteData();
$self = new self();

$self->receiptId = isset($request['receipt-id']) && $self::isReceiptIdValid(
$request['receipt-id']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class DonationFormPreviewRouteData
*
* @since 3.0.0
*/
public static function fromRequest(array $request): DonationFormPreviewRouteData
public static function fromRequest(array $request): self
{
$self = new DonationFormPreviewRouteData();
$self = new self();

$self->formId = (int)$request['form-id'];
$self->formSettings = !empty($request['form-settings']) ? FormSettings::fromJson(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class DonationFormQueryData
*
* @return DonationFormQueryData
*/
public static function fromObject($queryObject): DonationFormQueryData
public static function fromObject($queryObject): self
{
$self = new DonationFormQueryData();
$self = new self();
$self->id = (int)$queryObject->id;
$self->title = $queryObject->title;
$self->createdAt = Temporal::toDateTime($queryObject->createdAt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class DonationFormViewRouteData
*
* @since 3.0.0
*/
public static function fromRequest(array $request): DonationFormViewRouteData
public static function fromRequest(array $request): self
{
$self = new DonationFormViewRouteData();
$self = new self();

$self->formId = (int)$request['form-id'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LegacyPurchaseFormData
* @param array{donation: Donation, donor: Donation} $array
* @return LegacyPurchaseFormData
*/
public static function fromArray(array $array): LegacyPurchaseFormData
public static function fromArray(array $array): self
{
$self = new self();

Expand Down
4 changes: 2 additions & 2 deletions src/DonationForms/DataTransferObjects/UserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class UserData
*
* @since 3.0.0
*/
public static function fromUser(\WP_User $user): UserData
public static function fromUser(\WP_User $user): self
{
$self = new UserData();
$self = new self();

$self->firstName = $user->user_firstname;
$self->lastName = $user->user_lastname;
Expand Down
4 changes: 2 additions & 2 deletions src/DonationForms/DataTransferObjects/ValidationRouteData.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class ValidationRouteData implements Arrayable
*
* @since 3.0.0
*/
public static function fromRequest(array $requestData): ValidationRouteData
public static function fromRequest(array $requestData): self
{
$self = new ValidationRouteData();
$self = new self();
$self->formId = (int)$requestData['formId'];
$self->requestData = $requestData;

Expand Down

0 comments on commit b7b418f

Please sign in to comment.