@@ -97,6 +97,11 @@ class Alignment extends Supervisor
9797 */
9898 protected ?string $ horizontal = self ::HORIZONTAL_GENERAL ;
9999
100+ /**
101+ * Justify Last Line alignment.
102+ */
103+ protected ?string $ justifyLastLine = null ;
104+
100105 /**
101106 * Vertical alignment.
102107 */
@@ -196,6 +201,9 @@ public function applyFromArray(array $styleArray): static
196201 if (isset ($ styleArray ['horizontal ' ])) {
197202 $ this ->setHorizontal ($ styleArray ['horizontal ' ]);
198203 }
204+ if (isset ($ styleArray ['justifyLastLine ' ])) {
205+ $ this ->setJustifyLastLine ($ styleArray ['justifyLastLine ' ]);
206+ }
199207 if (isset ($ styleArray ['vertical ' ])) {
200208 $ this ->setVertical ($ styleArray ['vertical ' ]);
201209 }
@@ -255,6 +263,37 @@ public function setHorizontal(string $horizontalAlignment): static
255263 return $ this ;
256264 }
257265
266+ /**
267+ * Get Justify Last Line.
268+ */
269+ public function getJustifyLastLine (): null |string
270+ {
271+ if ($ this ->isSupervisor ) {
272+ return $ this ->getSharedComponent ()->getJustifyLastLine ();
273+ }
274+
275+ return $ this ->justifyLastLine ;
276+ }
277+
278+ /**
279+ * Set Justify Last Line.
280+ *
281+ * @param string $justifyLastLine see self::HORIZONTAL_*
282+ *
283+ * @return $this
284+ */
285+ public function setJustifyLastLine (string $ justifyLastLine ): static
286+ {
287+ if ($ this ->isSupervisor ) {
288+ $ styleArray = $ this ->getStyleArray (['justifyLastLine ' => $ justifyLastLine ]);
289+ $ this ->getActiveSheet ()->getStyle ($ this ->getSelectedCells ())->applyFromArray ($ styleArray );
290+ } else {
291+ $ this ->justifyLastLine = $ justifyLastLine ;
292+ }
293+
294+ return $ this ;
295+ }
296+
258297 /**
259298 * Get Vertical.
260299 */
@@ -489,6 +528,7 @@ protected function exportArray1(): array
489528 {
490529 $ exportedArray = [];
491530 $ this ->exportArray2 ($ exportedArray , 'horizontal ' , $ this ->getHorizontal ());
531+ $ this ->exportArray2 ($ exportedArray , 'justifyLastLine ' , $ this ->getJustifyLastLine ());
492532 $ this ->exportArray2 ($ exportedArray , 'indent ' , $ this ->getIndent ());
493533 $ this ->exportArray2 ($ exportedArray , 'readOrder ' , $ this ->getReadOrder ());
494534 $ this ->exportArray2 ($ exportedArray , 'shrinkToFit ' , $ this ->getShrinkToFit ());
0 commit comments