ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CellAlignment.php
Go to the documentation of this file.
1<?php
2
4
6
8{
12 private static $horizontalMap = [
19 ];
20
24 private static $verticalMap = [
29 ];
30
31 public static function horizontal(Alignment $alignment): int
32 {
33 $horizontalAlignment = $alignment->getHorizontal();
34
35 if (is_string($horizontalAlignment) && array_key_exists($horizontalAlignment, self::$horizontalMap)) {
36 return self::$horizontalMap[$horizontalAlignment];
37 }
38
39 return self::$horizontalMap[Alignment::HORIZONTAL_GENERAL];
40 }
41
42 public static function wrap(Alignment $alignment): int
43 {
44 $wrap = $alignment->getWrapText();
45
46 return ($wrap === true) ? 1 : 0;
47 }
48
49 public static function vertical(Alignment $alignment): int
50 {
51 $verticalAlignment = $alignment->getVertical();
52
53 if (is_string($verticalAlignment) && array_key_exists($verticalAlignment, self::$verticalMap)) {
54 return self::$verticalMap[$verticalAlignment];
55 }
56
57 return self::$verticalMap[Alignment::VERTICAL_BOTTOM];
58 }
59}
An exception for terminatinating execution or to throw for unit testing.