Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Rollylni committed Dec 18, 2020
1 parent 9001d0a commit 6cb06a2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ require "vendor/autoload.php";
use Triggers;

function example(Triggers $trigg) {
$trigg->handleTriggers("pre-loop");
$trigg->handle("pre-loop");
for ($i = 1; $i < 10; $i++) {
$trigg->handleTriggers("looping", [$i]);
$trigg->handle("looping", [$i]);
}
$trigg->handleTriggers("end-loop");
$trigg->handle("end-loop");
}

$trigg = new Triggers();
$trigg->addTrigger("pre-loop", function() {
$trigg->add("pre-loop", function() {
echo "starting loop!";
});

$trigg->addTrigger("looping", function($i) {
$trigg->add("looping", function($i) {
echo "looping $i iteration!";
});

$trigg->addTrigger("end-loop", function() {
$trigg->add("end-loop", function() {
echo "loop finished!";
});
example($trigg);
Expand Down

0 comments on commit 6cb06a2

Please sign in to comment.