1. Go to this page and download the library: Download rinsvent/dto2data 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/ */
rinsvent / dto2data example snippets
composer
class BuyRequest
{
public string $phrase;
public int $length;
public bool $isFirst;
}
interface BarInterface
{
}
class Bar implements BarInterface
{
public float $barField;
}
#[HelloSchema]
class HelloRequest
{
#[Trim]
public string $surname;
#[DataPath('fake_age')]
public int $age;
public array $emails;
public array $authors;
public array $authors2;
public array $authors3;
public BuyRequest $buy;
public BarInterface $bar;
}