/** * @param BorderPart $borderPart * @return string */ public static function serializeBorderPart(BorderPart $borderPart) { $definition = 'fo:border-%s="%s"'; if ($borderPart->getStyle() === Border::STYLE_NONE) { $borderPartDefinition = sprintf($definition, $borderPart->getName(), 'none'); } else { $attributes = [self::$widthMap[$borderPart->getWidth()], self::$styleMap[$borderPart->getStyle()], '#' . $borderPart->getColor()]; $borderPartDefinition = sprintf($definition, $borderPart->getName(), implode(' ', $attributes)); } return $borderPartDefinition; }
public function __construct($name) { $msg = '%s is not a valid name identifier for a border. Valid identifiers are: %s.'; parent::__construct(sprintf($msg, $name, implode(',', BorderPart::getAllowedNames()))); }
/** * Get the style definition from the style map * * @param BorderPart $borderPart * @return string */ protected static function getBorderStyle(BorderPart $borderPart) { return self::$xlsxStyleMap[$borderPart->getStyle()][$borderPart->getWidth()]; }