23 lines
506 B
PHP
23 lines
506 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace MintyPHP\Service\Export;
|
||
|
|
|
||
|
|
use Closure;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Column definition for CSV export.
|
||
|
|
*
|
||
|
|
* Header + extractor pair. The extractor receives the raw row
|
||
|
|
* and returns the cell value (scalar|null). Use $allowSignedNumeric
|
||
|
|
* for phone-number-like columns where a leading + or - is legitimate.
|
||
|
|
*/
|
||
|
|
final readonly class ExportColumn
|
||
|
|
{
|
||
|
|
public function __construct(
|
||
|
|
public string $header,
|
||
|
|
public Closure $extract,
|
||
|
|
public bool $allowSignedNumeric = false,
|
||
|
|
) {
|
||
|
|
}
|
||
|
|
}
|