Corby7 / educom-webshop-basis

0 stars 0 forks source link

Zorg dat je functies maar 1x definieert, dit is D.R.Y. #27

Closed JeroenHeemskerk closed 1 year ago

JeroenHeemskerk commented 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

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

JeroenHeemskerk commented 1 year ago

[!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.