@@ 61-68 (lines=8) @@ | ||
58 | * |
|
59 | * @return string |
|
60 | */ |
|
61 | public static function validateAlignment(string $alignment): string |
|
62 | { |
|
63 | if (!in_array($alignment, [self::ALIGNMENT_CENTER, self::ALIGNMENT_LEFT, self::ALIGNMENT_RIGHT], true)) { |
|
64 | throw new \InvalidArgumentException(sprintf('Unknown alignment "%s"', $alignment)); |
|
65 | } |
|
66 | ||
67 | return $alignment; |
|
68 | } |
|
69 | ||
70 | /** |
|
71 | * @param string $baseType |
|
@@ 77-84 (lines=8) @@ | ||
74 | * |
|
75 | * @return string |
|
76 | */ |
|
77 | public static function validateBaseType(string $baseType): string |
|
78 | { |
|
79 | if (!in_array($baseType, [self::BASETYPE_FOOTER, self::BASETYPE_HEADER], true)) { |
|
80 | throw new \InvalidArgumentException(sprintf('Unknown base type "%s"', $baseType)); |
|
81 | } |
|
82 | ||
83 | return $baseType; |
|
84 | } |
|
85 | ||
86 | /** |
|
87 | * @param string $type |
|
@@ 93-100 (lines=8) @@ | ||
90 | * |
|
91 | * @return string |
|
92 | */ |
|
93 | public static function validateType(string $type): string |
|
94 | { |
|
95 | if (!in_array($type, [self::TYPE_EVEN, self::TYPE_FIRST, self::TYPE_ODD], true)) { |
|
96 | throw new \InvalidArgumentException(sprintf('Unknown type "%s"', $type)); |
|
97 | } |
|
98 | ||
99 | return $type; |
|
100 | } |
|
101 | ||
102 | /** |
|
103 | * @param string $baseType |