PHP code example of amtgard / builder-traits
1. Go to this page and download the library: Download amtgard/builder-traits 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/ */
amtgard / builder-traits example snippets
use Builder;
Gato::builder()->age(7)->name("Charlie")->build();
class Gato {
use Getter;
private $name;
}
$catName = $gato->getName();
class Gato {
use Setter;
private $name;
}
$name = $gato->getName();
class Gato {
use Data;
private $name;
}
$gato->setName('Charlie');
$name = $gato->getName();
class Gato {
use ToBuilder;
private $name;
}
$chuck = $gato->toBuilder()->name('Charlie')->build();