PHP code example of paneon / php-to-typescript
1. Go to this page and download the library: Download paneon/php-to-typescript 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/ */
paneon / php-to-typescript example snippets
/**
* @TypeScriptInterface
*/
class Example
{
/**
* @var string
*/
public $firstName;
/**
* @var string|null
*/
public $middleName;
/**
* @var string
*/
public $lastName;
/**
* @var int|null
*/
public $age;
/** @var Contact[] */
public $contacts;
}
bash
$ php bin/console typescript:generate-single vendor/shopping/s2-communication-bundle/src/CommunicationBundle/DTO/ProductTeaser.php assets/js/interfaces/s2-communication-bundle/DTO/