1. Go to this page and download the library: Download guuzen/json-schema-codegen library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
declare(strict_types=1);
namespace App\Dto;
/**
* A sellable product
*/
final class Product
{
public function __construct(
/**
* The product name
*
* @var non-empty-string
*/
public $name,
/**
* @var int
*/
public $stock,
/**
* @var int<0, 1000>
*/
public $quantity,
/**
* @var int|null
*/
public $rating,
/**
* @var float
*/
public $price,
/**
* @var list<string>
*/
public $tags,
/**
* @var int|string
*/
public $externalId,
) {
}
}
final class Order
{
public function __construct(
/** @var Customer */
public $customer,
/** @var Note|null */
public $note,
/** @var list<OrderItem> */
public $items,
/** @var CreditCardPayment|BankTransferPayment */
public $payment,
) {
}
}