| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\OpenSpout\Common\Entity\Style; |
| 4 |
|
| 5 |
/** |
| 6 |
* This class provides constants to work with text alignment. |
| 7 |
*/ |
| 8 |
abstract class CellAlignment |
| 9 |
{ |
| 10 |
public const LEFT = 'left'; |
| 11 |
public const RIGHT = 'right'; |
| 12 |
public const CENTER = 'center'; |
| 13 |
public const JUSTIFY = 'justify'; |
| 14 |
private static $VALID_ALIGNMENTS = [self::LEFT => 1, self::RIGHT => 1, self::CENTER => 1, self::JUSTIFY => 1]; |
| 15 |
/** |
| 16 |
* @param string $cellAlignment |
| 17 |
* |
| 18 |
* @return bool Whether the given cell alignment is valid |
| 19 |
*/ |
| 20 |
public static function isValid($cellAlignment) |
| 21 |
{ |
| 22 |
return isset(self::$VALID_ALIGNMENTS[$cellAlignment]); |
| 23 |
} |
| 24 |
} |
| 25 |
|