Created
July 16, 2014 21:32
-
-
Save johncongdon/171bfe6d0414282fba4a to your computer and use it in GitHub Desktop.
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
protected function validateEventData($data) | |
{ | |
$days = (int)$data['pipeline_event_days']; | |
if ($data['pipeline_event_days'] != $days) | |
{ | |
throw new Exception('Invalid value for days'); | |
} | |
throw new Exception("....if ({$data['pipeline_event_days']} != $days)...."); | |
} | |
try{ | |
validateEventData(array('pipeline_event_days' => 'abc')); | |
} catch (Exception $e) { | |
print $e->getMessage() . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment