public function isBlack(string $text) : bool { foreach ($this->blackList as $black) { if (false !== strpos($text, $black)) { // There is a blacklisted word in the text return true; } } return false; }