Closed JeroenHeemskerk closed 1 year ago
De test_input functie in contact.php:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/contact.php#L84-L89 lijkt heel veel op test_input in login.php:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/login.php#L140-L145 lijkt heel veel op test_input in register.php:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/register.php#L142-L147
test_input
contact.php
login.php
register.php
Dit is niet D.R.Y.(uitleg D.R.Y), want als een andere ontwikkelaar een bug fixed dan kan er makkelijk een van de implementaties missen.
Zet zo'n functie dus in index.php of utils.php
index.php
utils.php
[!WARNING] Overigens zou ik de functie testInput noemen in camelCase in plaats van test_input in snake_case omdat al je andere functies en variabelen ook camelCase zijn.
testInput
De
test_input
functie incontact.php
:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/contact.php#L84-L89 lijkt heel veel optest_input
inlogin.php
:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/login.php#L140-L145 lijkt heel veel optest_input
inregister.php
:https://github.com/Corby7/educom-webshop-basis/blob/d790f5cc0a93b2101ab96454285ab7bcbea3cc20/register.php#L142-L147Dit is niet D.R.Y.(uitleg D.R.Y), want als een andere ontwikkelaar een bug fixed dan kan er makkelijk een van de implementaties missen.
Zet zo'n functie dus in
index.php
ofutils.php