@@ -97,6 +97,11 @@ class Alignment extends Supervisor
97
97
*/
98
98
protected ?string $ horizontal = self ::HORIZONTAL_GENERAL ;
99
99
100
+ /**
101
+ * Justify Last Line alignment.
102
+ */
103
+ protected ?string $ justifyLastLine = null ;
104
+
100
105
/**
101
106
* Vertical alignment.
102
107
*/
@@ -196,6 +201,9 @@ public function applyFromArray(array $styleArray): static
196
201
if (isset ($ styleArray ['horizontal ' ])) {
197
202
$ this ->setHorizontal ($ styleArray ['horizontal ' ]);
198
203
}
204
+ if (isset ($ styleArray ['justifyLastLine ' ])) {
205
+ $ this ->setJustifyLastLine ($ styleArray ['justifyLastLine ' ]);
206
+ }
199
207
if (isset ($ styleArray ['vertical ' ])) {
200
208
$ this ->setVertical ($ styleArray ['vertical ' ]);
201
209
}
@@ -255,6 +263,37 @@ public function setHorizontal(string $horizontalAlignment): static
255
263
return $ this ;
256
264
}
257
265
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
+
258
297
/**
259
298
* Get Vertical.
260
299
*/
@@ -489,6 +528,7 @@ protected function exportArray1(): array
489
528
{
490
529
$ exportedArray = [];
491
530
$ this ->exportArray2 ($ exportedArray , 'horizontal ' , $ this ->getHorizontal ());
531
+ $ this ->exportArray2 ($ exportedArray , 'justifyLastLine ' , $ this ->getJustifyLastLine ());
492
532
$ this ->exportArray2 ($ exportedArray , 'indent ' , $ this ->getIndent ());
493
533
$ this ->exportArray2 ($ exportedArray , 'readOrder ' , $ this ->getReadOrder ());
494
534
$ this ->exportArray2 ($ exportedArray , 'shrinkToFit ' , $ this ->getShrinkToFit ());
0 commit comments