I am currently developing my PHP SDK to interact with a REST API. Let's say the API can create a 'car' model. To create a car I would write something like this...
$car = $api->create('car', array(
'wheels' => 6,
'color' => 'blue'
));
If another developer downloads my SDK and tries to create a car model incorrectly and forgets to include required arguments. How can I throw an exception via the SDK to notify the developer of missing arguments, other than them seeing a PHP error like Warning: Missing argument 1 for BMW::create() which does not include many details.
Exception, and then throw it viathrow new CarException