public function padBoth($length, $padStr = ' ')
    {
        $padding = $length - $this->getLength();
        return $this->applyPadding(floor($padding / 2), ceil($padding / 2), $padStr);
    }
public function padBoth($length, $padStr = ' ')
    {
        $padding = $length - $this->getLength();
        return $this->applyPadding(floor($padding / 2), ceil($padding / 2), $padStr);
    }
public function padBoth ( $ length , $ padStr = ' ' ) { $ padding = $ length - $ this -> getLength ( ) ; return $ this -> applyPadding ( floor ( $ padding / 2 ) , ceil ( $ padding / 2 ) , $ padStr ) ; }
Adds padding to both sides of the string, equally.

@param  int    $length Desired string length after padding.

@param  string $padStr String used to pad, defaults to space.

@return static         String with padding applied to both sides.
Adds padding to both sides of the string equally .