PHP code example of aviator / runnable
1. Go to this page and download the library: Download aviator/runnable 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/ */
aviator / runnable example snippets
class Something
{
use RunnableTrait;
}
$closure = Something::run($arg1);
$result = $closure($arg2);
// Or just:
$result = Something::run($arg1)($arg2);
interface SomeInterface extends Runnable, SomeOtherInterface
{
/* etc */
}
class Something
{
use RunnableTrait;
protected static $method = 'handle';
public function handle ($arg)
{
/* etc */
}
}
$result = Something::run()('arg');
// Calls the handle() method.