This doesn't need to be so wordy or include the adapted for piece.  Just keep it simple like https://github.com/wilsonge/joomla-cms/blob/32e61de90ca2e1b5d226c8098e50029466ef961e/libraries/joomla/filter/input.php#L15 please (I know, I'm anal retentive over this doc block stuff :-P )