aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2019-05-18 00:39:38 -0400
committerThedro Neely <thedroneely@gmail.com>2019-05-18 00:39:38 -0400
commit392e83e25c1f6c7a1bfd1801174a4703dd66f97f (patch)
treeef7881d86bd808e56ef4e3689f4880d69aa38603 /app
parent51c0cc199f30e195eafbf04e6be09dd8b2561574 (diff)
downloadthedroneely.com-392e83e25c1f6c7a1bfd1801174a4703dd66f97f.tar.gz
thedroneely.com-392e83e25c1f6c7a1bfd1801174a4703dd66f97f.tar.bz2
thedroneely.com-392e83e25c1f6c7a1bfd1801174a4703dd66f97f.zip
app/model/Form: Remove repetitive method naming scheme
Diffstat (limited to 'app')
-rw-r--r--app/controllers/contact.controller.php8
-rw-r--r--app/model/Form.php8
2 files changed, 8 insertions, 8 deletions
diff --git a/app/controllers/contact.controller.php b/app/controllers/contact.controller.php
index 803a67c..f7fa5ed 100644
--- a/app/controllers/contact.controller.php
+++ b/app/controllers/contact.controller.php
@@ -9,17 +9,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$form->message = $message = $_POST['26478'] ?? null;
$form->spam = $spam = $_POST['agree'] ?? false;
- if ($form->isEmpty()) {
+ if ($form->empty()) {
include '../app/views/contact.view.php';
return;
}
- if ($form->isSpam()) {
+ if ($form->spam()) {
error_log('Contact Form Spam: Error 403');
return http_response_code(403);
}
- if ($form->isEmailValid() === false) {
+ if ($form->emailValid() === false) {
$emailError = 'Invalid email: ' . "\r" . '<b>'. $email . '</b>';
include '../app/views/contact.view.php';
return;
@@ -43,7 +43,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
]
);
- $form->isSubmit();
+ $form->submit();
return;
}
diff --git a/app/model/Form.php b/app/model/Form.php
index 7d972e7..f3d7a15 100644
--- a/app/model/Form.php
+++ b/app/model/Form.php
@@ -10,7 +10,7 @@ class Form
public $message;
public $spam;
- public function isSpam()
+ public function spam()
{
if ((bool) $this->spam == true) {
error_log('Contact Form Spam: Error 403');
@@ -18,7 +18,7 @@ class Form
}
}
- public function isEmpty()
+ public function empty()
{
if ((bool) empty($this->email) == true
|| (bool) empty($this->message) == true
@@ -27,12 +27,12 @@ class Form
}
}
- public function isEmailValid()
+ public function emailValid()
{
return $email = PHPMailer::validateAddress($this->email, 'auto');
}
- public function isSubmit()
+ public function submit()
{
// Include mail config
$config = include '../AppConfig.php';