1. Go to this page and download the library: Download flarone/reflection 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/ */
flarone / reflection example snippets
composer
use Flarone\Reflection\ReflectableTrait
class ModelTest extends PHPUnit_Framework_TestCase
{
use ReflectableTrait;
}
$randomClass = new RandomClass();
$this->reflect($randomClass);
$randomClass = new RandomClass();
$this->on($randomClass)->call($method, $args = []);
// Considering phpunit
protected function setUp()
{
$this->foo = new Foo();
$this->reflect($this->foo);
}
public function test_something()
{
$hello = $this->callSayHello(); // this will call SayHello() of class `Foo`
$this->assertEquals('Hello', $hello);
$hello = $this->on(new FooBar())->callSayHello(); // this will call SayHello() of class `FooBar`
$this->assertEquals('Hello FooBar', $hello);
$hello = $this->callSayHello(); // this will call SayHello() of class `Foo`
$this->assertEquals('Hello', $hello);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.