PHP code example of komex / influence

1. Go to this page and download the library: Download komex/influence 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/ */

    

komex / influence example snippets



Influence\Influence::affect();

class A
{
    public function sum($a)
    {
        return $a + $this->rand(0, $a);
    }
    private fuction rand($min, $max)
    {
        return rand($min, $max);
    }
}

$a = new A();
echo $a->sum(1); // ??
echo $a->sum(7); // ??

$a = new A();
$method = Influence\RemoteControl::controlObject($a)->get('rand');
$method->setValue(new Value(1));
echo $a->sum(1); // 2
echo $a->sum(7); // 8
$method->setValue();
echo $a->sum(1); // ??
echo $a->sum(7); // ??

$a = new A();
$method = Influence\RemoteControl::controlObject($a)->get('rand');
$method->setLog(true);
echo $a->sum(1); // ??
echo $a->sum(7); // ??
var_dump($method->getLogs()); // [ [0, 1], [0, 7] ]
$a