| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class DateColumn implements ColumnFormatter { |
||
| 14 | |||
| 15 | private $_dateFormat; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * DateColumn constructor. |
||
| 19 | * @param string $dateFormat |
||
| 20 | */ |
||
| 21 | 5 | public function __construct(string $dateFormat = 'Y-m-d H:i:s') |
|
| 22 | { |
||
| 23 | 5 | $this->_dateFormat = $dateFormat; |
|
| 24 | 5 | } |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Set the format of the date column, e.g. "Y-m-d H:i:s". |
||
| 28 | * |
||
| 29 | * @param string $dateFormat |
||
| 30 | * @return DateColumn |
||
| 31 | */ |
||
| 32 | 1 | public function dateFormat(string $dateFormat) : DateColumn |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param Model $rowModel |
||
| 41 | * @param string $column |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 4 | public function format(Model $rowModel, string $column) : string |
|
| 47 | } |
||
| 48 | } |