PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / vendor / openspout / openspout / src / Writer / XLSX / Helper / BorderHelper.php

BorderHelper.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.5, at vendor/openspout/openspout/src/Writer/XLSX/Helper/BorderHelper.php

30 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\OpenSpout\Writer\XLSX\Helper;
4
5 use FluentCart\OpenSpout\Common\Entity\Style\Border;
6 use FluentCart\OpenSpout\Common\Entity\Style\BorderPart;
7 class BorderHelper
8 {
9 public static $xlsxStyleMap = [Border::STYLE_SOLID => [Border::WIDTH_THIN => 'thin', Border::WIDTH_MEDIUM => 'medium', Border::WIDTH_THICK => 'thick'], Border::STYLE_DOTTED => [Border::WIDTH_THIN => 'dotted', Border::WIDTH_MEDIUM => 'dotted', Border::WIDTH_THICK => 'dotted'], Border::STYLE_DASHED => [Border::WIDTH_THIN => 'dashed', Border::WIDTH_MEDIUM => 'mediumDashed', Border::WIDTH_THICK => 'mediumDashed'], Border::STYLE_DOUBLE => [Border::WIDTH_THIN => 'double', Border::WIDTH_MEDIUM => 'double', Border::WIDTH_THICK => 'double'], Border::STYLE_NONE => [Border::WIDTH_THIN => 'none', Border::WIDTH_MEDIUM => 'none', Border::WIDTH_THICK => 'none']];
10 /**
11 * @return string
12 */
13 public static function serializeBorderPart(BorderPart $borderPart)
14 {
15 $borderStyle = self::getBorderStyle($borderPart);
16 $colorEl = $borderPart->getColor() ? \sprintf('<color rgb="%s"/>', $borderPart->getColor()) : '';
17 $partEl = \sprintf('<%s style="%s">%s</%s>', $borderPart->getName(), $borderStyle, $colorEl, $borderPart->getName());
18 return $partEl . \PHP_EOL;
19 }
20 /**
21 * Get the style definition from the style map.
22 *
23 * @return string
24 */
25 protected static function getBorderStyle(BorderPart $borderPart)
26 {
27 return self::$xlsxStyleMap[$borderPart->getStyle()][$borderPart->getWidth()];
28 }
29 }
30