This can probably be written as just `if (trim($text)) {`