Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 239
openapi_spec_hash: f0a8620e85b9d96f7ebd57a165897ee4
openapi_spec_hash: b6377bd92e2965a404a8faebd258a35f
config_hash: 1ca082e374ef7000e2a5971e8da740e0
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* @phpstan-type TrackingUpdateShape = array{
* carrierEstimatedDeliveryAt: \DateTimeInterface|null,
* category: Category|value-of<Category>,
* country: string,
* createdAt: \DateTimeInterface,
Expand All @@ -22,6 +23,12 @@ final class TrackingUpdate implements BaseModel
/** @use SdkModel<TrackingUpdateShape> */
use SdkModel;

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the carrier expects the check to be delivered.
*/
#[Required('carrier_estimated_delivery_at')]
public ?\DateTimeInterface $carrierEstimatedDeliveryAt;

/**
* The type of tracking event.
*
Expand Down Expand Up @@ -54,14 +61,19 @@ final class TrackingUpdate implements BaseModel
* To enforce required parameters use
* ```
* TrackingUpdate::with(
* category: ..., country: ..., createdAt: ..., postalCode: ...
* carrierEstimatedDeliveryAt: ...,
* category: ...,
* country: ...,
* createdAt: ...,
* postalCode: ...,
* )
* ```
*
* Otherwise ensure the following setters are called
*
* ```
* (new TrackingUpdate)
* ->withCarrierEstimatedDeliveryAt(...)
* ->withCategory(...)
* ->withCountry(...)
* ->withCreatedAt(...)
Expand All @@ -81,13 +93,15 @@ public function __construct()
* @param Category|value-of<Category> $category
*/
public static function with(
?\DateTimeInterface $carrierEstimatedDeliveryAt,
Category|string $category,
string $country,
\DateTimeInterface $createdAt,
string $postalCode,
): self {
$self = new self;

$self['carrierEstimatedDeliveryAt'] = $carrierEstimatedDeliveryAt;
$self['category'] = $category;
$self['country'] = $country;
$self['createdAt'] = $createdAt;
Expand All @@ -96,6 +110,18 @@ public static function with(
return $self;
}

/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the carrier expects the check to be delivered.
*/
public function withCarrierEstimatedDeliveryAt(
?\DateTimeInterface $carrierEstimatedDeliveryAt
): self {
$self = clone $this;
$self['carrierEstimatedDeliveryAt'] = $carrierEstimatedDeliveryAt;

return $self;
}

/**
* The type of tracking event.
*
Expand Down
36 changes: 18 additions & 18 deletions src/Entities/Entity/Trust/Grantor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* @phpstan-import-type IdentificationShape from \Increase\Entities\Entity\Trust\Grantor\Identification
*
* @phpstan-type GrantorShape = array{
* address: \Increase\Entities\Entity\Trust\Grantor\Address|AddressShape,
* dateOfBirth: string,
* address: null|\Increase\Entities\Entity\Trust\Grantor\Address|AddressShape,
* dateOfBirth: string|null,
* identification: null|Identification|IdentificationShape,
* name: string,
* }
Expand All @@ -29,25 +29,25 @@ final class Grantor implements BaseModel
use SdkModel;

/**
* The person's address.
* The grantor's address.
*/
#[Required]
public Address $address;
public ?Address $address;

/**
* The person's date of birth in YYYY-MM-DD format.
* The grantor's date of birth in YYYY-MM-DD format.
*/
#[Required('date_of_birth')]
public string $dateOfBirth;
public ?string $dateOfBirth;

/**
* A means of verifying the person's identity.
* A means of verifying the grantor's identity.
*/
#[Required]
public ?Identification $identification;

/**
* The person's legal name.
* The grantor's legal name.
*/
#[Required]
public string $name;
Expand Down Expand Up @@ -80,12 +80,12 @@ public function __construct()
*
* You must use named parameters to construct any parameters with a default value.
*
* @param Address|AddressShape $address
* @param Address|AddressShape|null $address
* @param Identification|IdentificationShape|null $identification
*/
public static function with(
Address|array $address,
string $dateOfBirth,
Address|array|null $address,
?string $dateOfBirth,
Identification|array|null $identification,
string $name,
): self {
Expand All @@ -100,12 +100,12 @@ public static function with(
}

/**
* The person's address.
* The grantor's address.
*
* @param Address|AddressShape $address
* @param Address|AddressShape|null $address
*/
public function withAddress(
Address|array $address
Address|array|null $address
): self {
$self = clone $this;
$self['address'] = $address;
Expand All @@ -114,9 +114,9 @@ public function withAddress(
}

/**
* The person's date of birth in YYYY-MM-DD format.
* The grantor's date of birth in YYYY-MM-DD format.
*/
public function withDateOfBirth(string $dateOfBirth): self
public function withDateOfBirth(?string $dateOfBirth): self
{
$self = clone $this;
$self['dateOfBirth'] = $dateOfBirth;
Expand All @@ -125,7 +125,7 @@ public function withDateOfBirth(string $dateOfBirth): self
}

/**
* A means of verifying the person's identity.
* A means of verifying the grantor's identity.
*
* @param Identification|IdentificationShape|null $identification
*/
Expand All @@ -139,7 +139,7 @@ public function withIdentification(
}

/**
* The person's legal name.
* The grantor's legal name.
*/
public function withName(string $name): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Entity/Trust/Grantor/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Increase\Core\Contracts\BaseModel;

/**
* The person's address.
* The grantor's address.
*
* @phpstan-type AddressShape = array{
* city: string|null,
Expand Down
10 changes: 5 additions & 5 deletions src/Entities/Entity/Trust/Grantor/Identification.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Increase\Entities\Entity\Trust\Grantor\Identification\Method;

/**
* A means of verifying the person's identity.
* A means of verifying the grantor's identity.
*
* @phpstan-type IdentificationShape = array{
* method: Method|value-of<Method>, numberLast4: string
Expand All @@ -22,15 +22,15 @@ final class Identification implements BaseModel
use SdkModel;

/**
* A method that can be used to verify the individual's identity.
* A method that can be used to verify the grantor's identity.
*
* @var value-of<Method> $method
*/
#[Required(enum: Method::class)]
public string $method;

/**
* The last 4 digits of the identification number that can be used to verify the individual's identity.
* The last 4 digits of the identification number that can be used to verify the grantor's identity.
*/
#[Required('number_last4')]
public string $numberLast4;
Expand Down Expand Up @@ -74,7 +74,7 @@ public static function with(
}

/**
* A method that can be used to verify the individual's identity.
* A method that can be used to verify the grantor's identity.
*
* @param Method|value-of<Method> $method
*/
Expand All @@ -87,7 +87,7 @@ public function withMethod(Method|string $method): self
}

/**
* The last 4 digits of the identification number that can be used to verify the individual's identity.
* The last 4 digits of the identification number that can be used to verify the grantor's identity.
*/
public function withNumberLast4(string $numberLast4): self
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Increase\Entities\Entity\Trust\Grantor\Identification;

/**
* A method that can be used to verify the individual's identity.
* A method that can be used to verify the grantor's identity.
*/
enum Method: string
{
Expand Down
12 changes: 6 additions & 6 deletions src/Entities/EntityCreateParams/Trust/Grantor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ final class Grantor implements BaseModel
use SdkModel;

/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
* The grantor's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
*/
#[Required]
public Address $address;

/**
* The person's date of birth in YYYY-MM-DD format.
* The grantor's date of birth in YYYY-MM-DD format.
*/
#[Required('date_of_birth')]
public string $dateOfBirth;
Expand All @@ -49,7 +49,7 @@ final class Grantor implements BaseModel
public Identification $identification;

/**
* The person's legal name.
* The grantor's legal name.
*/
#[Required]
public string $name;
Expand Down Expand Up @@ -111,7 +111,7 @@ public static function with(
}

/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
* The grantor's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
*
* @param Address|AddressShape $address
*/
Expand All @@ -125,7 +125,7 @@ public function withAddress(
}

/**
* The person's date of birth in YYYY-MM-DD format.
* The grantor's date of birth in YYYY-MM-DD format.
*/
public function withDateOfBirth(string $dateOfBirth): self
{
Expand All @@ -150,7 +150,7 @@ public function withIdentification(
}

/**
* The person's legal name.
* The grantor's legal name.
*/
public function withName(string $name): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/EntityCreateParams/Trust/Grantor/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Increase\Core\Contracts\BaseModel;

/**
* The individual's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
* The grantor's physical address. Mail receiving locations like PO Boxes and PMB's are disallowed.
*
* @phpstan-type AddressShape = array{
* city: string,
Expand Down