public static function buildBorder($string, Border $border)
    {
        switch ($border->getType()) {
            case Border::TYPE_UNDERLINE:
                $result = self::buildUnderline($string, $border);
                break;
            case Border::TYPE_FRAME:
                $result = self::buildFrame($string, $border);
                break;
            default:
                throw new Exception('Unknown border type ' . $border->getType());
        }

        return $result;
    }
public static function buildBorder($string, Border $border)
    {
        switch ($border->getType()) {
            case Border::TYPE_UNDERLINE:
                $result = self::buildUnderline($string, $border);
                break;
            case Border::TYPE_FRAME:
                $result = self::buildFrame($string, $border);
                break;
            default:
                throw new Exception('Unknown border type ' . $border->getType());
        }

        return $result;
    }
public static function buildBorder ( $ string , Border $ border ) { switch ( $ border -> getType ( ) ) { case Border :: TYPE_UNDERLINE : $ result = self :: buildUnderline ( $ string , $ border ) ; break ; case Border :: TYPE_FRAME : $ result = self :: buildFrame ( $ string , $ border ) ; break ; default : throw new Exception ( 'Unknown border type ' . $ border -> getType ( ) ) ; } return $ result ; }
Render bordered string

@param string $string
@param Border $border

@return string
@throws Exception
Render bordered string