private function check_parameters($num_args, $expected_num_args, $method_name) { if ($num_args != $expected_num_args) { throw new Exception("Unexpected parameter passed to {$method_name}"); } return; }