Skip to content

Commit

Permalink
Make issuerName and programName optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chiiya committed Feb 20, 2025
1 parent 3fd810f commit 66c1c42
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
15 changes: 7 additions & 8 deletions src/Google/Passes/BaseClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
abstract class BaseClass extends AbstractClass
{
public function __construct(
/**
* Required.
* The issuer name. Recommended maximum length is 20 characters to ensure full string is displayed on
* smaller screens.
*/
#[NotBlank]
#[Length(max: 20)]
public string $issuerName,
/**
* Required.
* The status of the class.
Expand All @@ -43,6 +35,13 @@ public function __construct(
])]
#[Cast(LegacyValueCaster::class, ReviewStatus::class)]
public string $reviewStatus,
/**
* Required when creating.
* The issuer name. Recommended maximum length is 20 characters to ensure full string is displayed on
* smaller screens.
*/
#[Length(max: 20)]
public ?string $issuerName = null,
/**
* Optional.
* An array of messages displayed in the app. All users of this object will receive its associated messages.
Expand Down
14 changes: 6 additions & 8 deletions src/Google/Passes/LoyaltyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,25 @@
use Chiiya\Passes\Google\Components\Common\LocalizedString;
use Chiiya\Passes\Google\Components\Loyalty\DiscoverableProgram;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;

class LoyaltyClass extends BaseClass
{
/** @var string */
final public const IDENTIFIER = 'loyaltyClass';

public function __construct(
/**
* Required.
* The program name, such as "Adam's Apparel". The app may display an ellipsis after the first 20
* characters to ensure full string is displayed on smaller screens.
*/
#[NotBlank]
public string $programName,
/**
* Required.
* The logo of the loyalty program or company. This logo is displayed in both the details and list
* views of the app.
*/
public Image $programLogo,
/**
* Required when creating.
* The program name, such as "Adam's Apparel". The app may display an ellipsis after the first 20
* characters to ensure full string is displayed on smaller screens.
*/
public ?string $programName = null,
/**
* Optional.
* The wide logo of the loyalty program or company. When provided, this will be used in place of the program logo in the top left of the card view.
Expand Down

0 comments on commit 66c1c42

Please sign in to comment.