Skip to content

Commit

Permalink
Print funny joke only 1/10 times
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Apr 25, 2024
1 parent 3d14617 commit 300a024
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/app/src/Endpoint/Event/LikeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ public function __invoke(Liked $event): void
"When %s compiles, time stops to admire.",
"The only test %s fails is the test of time.",
"%s doesn't need to optimize. It's already perfect.",
"When %s runs, CPU usage drops out of respect."
"When %s runs, CPU usage drops out of respect.",
];

$phrase = $phrases[\array_rand($phrases)];
$shouldPrint = \random_int(1, 10) === 1;
if (!$shouldPrint) {
return;
}

$phrase = $phrases[\array_rand($phrases)];
dump(\sprintf($phrase, $event->key));
}
}

0 comments on commit 300a024

Please sign in to comment.