Best way to throw exception and avoid code duplication
- by JF Dion
I am currently writing code and want to make sure all the params that get passed to a function/method are valid. Since I am writing in PHP I don't have access to all the facilities of other languages like C, C++ or Java to check for parameters values and types
public function inscriptionExists($sectionId, $userId) // PHP
vs.
public boolean…