Last active
August 28, 2019 06:46
-
-
Save Herrytheeagle/1a54af058af3e63847f71512d4264196 to your computer and use it in GitHub Desktop.
Quality Code Description 3
This file contains 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
//Dirty code example | |
// Check to see if the employee is eligible for full benefits | |
if ($employee->flags && self::HOURLY_FLAG && $employee->age > 65) | |
//Clean code example | |
if ($employee->isEligibleForFullBenefits()) | |
//Dirty code example | |
if (7 == $today) { | |
return ‘It is holiday’; | |
} | |
//Clean code example | |
const SATURDAY = 7; | |
if (self::SATURDAY == $today) { | |
return ‘It is holiday’; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
QCD