1. Go to this page and download the library: Download timetoogo/php-generics 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/ */
timetoogo / php-generics example snippets
$Configuration = new \Generics\Configuration();
$Configuration->SetIsDevelopmentMode(true);
$Configuration->SetRootPath(__DIR__);
$Configuration->SetCachePath(__DIR__ . '/Cache');
//Register the generic auto loader
\Generics\Loader::Register($Configuration);
class Maybe {
private $MaybeValue;
public function __construct(__TYPE__ $Value = null) {
$this->MaybeValue = $Value;
}
public function HasValue() {
return $this->MaybeValue !== null;
}
public function GetValue() {
return $this->MaybeValue;
}
public function SetValue(__TYPE__ $Value = null) {
$this->MaybeValue = $Value;
}
}
$Tuple = new TupleOf\Foo\Bar\SomeClass\_\DateTime();
class TupleOfBarAndBaz extends TupleOf\Bar\_\Baz {
//...
}
interface IHaveOne {
public function GetOne();
public function SetOne(__TYPE__ $One);
}
class User implements IHaveOne\Account {
private $One;
public function GetOne(){
return $this->One;
}
public function SetOne(Account $One) {
$this->One = $One;
}
}
$ArrayOfArrayOfStandardClasses = new ArrayOf\ArrayOf\stdClass();
class Example extends __TYPE1__ implements __TYPE2__, __TYPE3__ {
use __TYPE4__, __TYPE5__;
}
javascript
{
"/php-generics": "0.2.4"
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.