Skip to content

Instantly share code, notes, and snippets.

@erop
Created April 27, 2021 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erop/da18add9421f7dcebd2dcb8bbc14bda1 to your computer and use it in GitHub Desktop.
Save erop/da18add9421f7dcebd2dcb8bbc14bda1 to your computer and use it in GitHub Desktop.
Class Passport annotated with @DocumentField
<?php
declare(strict_types=1);
namespace App\DocumentType;
use App\Annotation\DocumentField;
final class Passport implements IDocument
{
/**
* @DocumentField(label="First name")
*/
public string $firstName;
/**
* @DocumentField(label="Last name")
*/
public string $lastName;
/**
* @DocumentField(label="Citizenship")
*/
public string $citizenship;
/**
* @DocumentField(label="Series")
*/
public string $series;
/**
* @DocumentField(label="Number")
*/
public string $number;
public function getType(): string
{
return 'passport';
}
public function getName(): string
{
return 'Passport';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment