Skip to content

Commit

Permalink
add second example
Browse files Browse the repository at this point in the history
  • Loading branch information
deoomen committed Jul 13, 2020
1 parent 3ca7285 commit 73ccb1d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/example2_checkForSwears.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* PleaseDontSwear checkForSwears method example
*/

require_once __DIR__ . '/../src/PleaseDontSwear.php'; // unnecesary if you use autoload

use PleaseDontSwear\PleaseDontSwear;

$PDS = new PleaseDontSwear();

// Aleksander Fredro, "Sztuka obłapiania" (original title "Sztuka jebania"), 1817
$myBadText = "Jeb, Młodzieńcze, jeb, lecz miej zwyczaj drogi,
Ze świecą kurwie patrzeć między nogi.";

$myNiceText = "Siała baba mak, nie wiedziała jak.
Dziadek wiedział, nie powiedział, a to było TAK!";

if ($PDS->checkForSwears($myBadText)) {
echo "Ugh... Ugly text.";
} else {
echo "Nice text.";
}

if ($PDS->checkForSwears($myNiceText)) {
echo "Ugh... Ugly text.";
} else {
echo "Nice text.";
}

0 comments on commit 73ccb1d

Please sign in to comment.