feat: Type hinting all the way.

This commit is contained in:
muli 2022-08-24 08:03:54 +02:00
parent aebb53e5c1
commit 590cbfbb65
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ function prepare_message_body(string $message, string $name) {
* mail(): Braucht auf dem Server einen korrekt konfigurierten Mailserver
* phpmailer: Bibliothek, der per Composer installiert wird. Tut ganz gut mit SMTP.
*/
function send_message_to_office($subject, $message, $name, $email) {
function send_message_to_office(string $subject, string $message, string $name, string $email) {
return mail(
getenv('WTF_CONTACT_TO'),
"=?UTF-8?B?" . base64_encode($subject) . "?=",
@ -48,7 +48,7 @@ function send_message_to_office($subject, $message, $name, $email) {
);
}
function send_response($response_data) {
function send_response(array $response_data) {
$json = json_encode($response_data);
if ($json === false) {
// Avoid echo of empty string (which is invalid JSON), and