Example #1
0
if ($success) {
    echo "Success!\n\n";
} else {
    echo "Failure...\n\n";
}
echo "Operations -- \n";
echo "    Instantiate Handler (And Attach as Listener) -> ";
$success = true;
$handler = null;
try {
    $handler = new Event\Handler(null, function ($e) {
        echo "\n";
        var_dump($e->getState());
        echo "\n";
    }, null, array('strict' => true));
    $testClass->getTracker()->attachListener($handler);
} catch (\Exception $e) {
    $success = false;
}
if ($success) {
    echo "Success!\n\n";
} else {
    echo "Failure...\n\n";
}
echo "Fire! -> ";
$success = true;
try {
    $testClass->setOff();
} catch (\Exception $e) {
    $success = false;
}