PHP code example of fruit / compilekit
1. Go to this page and download the library: Download fruit/compilekit 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/ */
fruit / compilekit example snippets
ruit\CompileKit\AnonymousClass as C;
use Fruit\CompileKit\FunctionCall as Call;
use Fruit\CompileKit\Block;
use Fruit\CompileKit\Value;
$b = (new Block)
->reqOnce('vendor/autoload.php')
->space()
->use('PHPUnit\Framework\TestCase', 'TC')
->space();
$c = (new C)->extends('TC');
$c
->can('testExample')
->line('$this->assertTrue(true);');
$b->return(
(new Call('var_export'))->arg($c)->arg(true)
);
echo '' . "\n" . $b->render(true);
PHPUnit\Framework\TestCase as TC;
return var_export(
new class(
) extends TC
{
public function testExample()
{
$this->assertTrue(true);
}
},
true
);