Some code improvements.

This commit is contained in:
James Cole
2015-07-05 19:57:44 +02:00
parent c4ef379d0e
commit 170aebfe54
5 changed files with 57 additions and 31 deletions

View File

@@ -0,0 +1,58 @@
<?php
namespace FireflyIII\Helpers\Csv\Specifix;
/**
* Class RabobankDescription
*
* @package FireflyIII\Helpers\Csv\Specifix
*/
class RabobankDescription
{
/** @var array */
protected $data;
/** @var array */
protected $row;
/**
* @return array
*/
public function fix()
{
$this->rabobankFixEmptyOpposing();
return $this->data;
}
/**
* Fixes Rabobank specific thing.
*/
protected function rabobankFixEmptyOpposing()
{
if (strlen($this->data['opposing-account-name']) == 0) {
$this->data['opposing-account-name'] = $this->row[10];
}
$this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description']));
}
/**
* @param array $data
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @param array $row
*/
public function setRow($row)
{
$this->row = $row;
}
}