Last active
October 3, 2018 12:55
-
-
Save joaorobertopb/56c2033ae1640dda80d47c97f5a4db34 to your computer and use it in GitHub Desktop.
Clean Code concepts - PHP Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ymd = date('Y-m-d'); // Ruim | |
$currentDate = date('Y-m-d'); // Bom | |
/* Ruim */ var $d = 0; //quantidade de dias trabalhados | |
/* Bom */ var $workDays = 0; | |
//Ruim | |
foreach ($people as $p) { | |
echo $p->name; | |
} | |
//Bom | |
foreach ($people as $person) { | |
echo $person->name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment