public function pad($length, $padStr = ' ', $padType = 'right')
{
if (!in_array($padType, array('left', 'right', 'both'))) {
throw new InvalidArgumentException('Pad expects $padType ' . "to be one of 'left', 'right' or 'both'");
}
switch ($padType) {
case 'left':
return $this->padLeft($length, $padStr);
case 'right':
return $this->padRight($length, $padStr);
default:
return $this->padBoth($length, $padStr);
}
}