<?php
class Yo
{
public function Register($mail, $pass)
{
try
{
$this->RegisterPerson($mail, $pass);
}
catch(\Exception $ex)
{
/*$this->log()*/
echo("Some problem .. ". $ex->getMessage());
}
}
private function RegisterPerson($mail, $pass)
{
if(empty($mail))
throw new \InvalidArgumentException("Mail should not be empty. Passed <$mail>");
if(empty($pass))
throw new \InvalidArgumentException("Password should not be empty. Passed <$pass>");
echo 'registering this guy..';
}
}
$yo = new Yo();
$yo -> Register('[email protected]', '');
1