mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-23 23:13:18 -06:00
40 lines
783 B
PHP
40 lines
783 B
PHP
<?php
|
|
declare(strict_types = 1);
|
|
namespace FireflyIII\Helpers\Csv\PostProcessing;
|
|
|
|
/**
|
|
* Class Description
|
|
*
|
|
* @package FireflyIII\Helpers\Csv\PostProcessing
|
|
*/
|
|
class Description implements PostProcessorInterface
|
|
{
|
|
|
|
/** @var array */
|
|
protected $data;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function process(): array
|
|
{
|
|
$description = $this->data['description'] ?? '';
|
|
$this->data['description'] = trim($description);
|
|
if (strlen($this->data['description']) == 0) {
|
|
$this->data['description'] = trans('firefly.csv_empty_description');
|
|
}
|
|
|
|
|
|
return $this->data;
|
|
}
|
|
|
|
/**
|
|
* @param array $data
|
|
*/
|
|
public function setData(array $data)
|
|
{
|
|
|
|
$this->data = $data;
|
|
}
|
|
}
|