2016-07-16 07:58:25 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* RabobankDebetCredit.php
|
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
|
*
|
2016-10-05 06:52:15 +02:00
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
|
*
|
|
|
|
|
* See the LICENSE file for details.
|
2016-07-16 07:58:25 +02:00
|
|
|
*/
|
|
|
|
|
|
2017-04-09 07:44:22 +02:00
|
|
|
declare(strict_types=1);
|
2016-07-16 07:58:25 +02:00
|
|
|
|
|
|
|
|
namespace FireflyIII\Import\Converter;
|
|
|
|
|
|
|
|
|
|
use Log;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class RabobankDebetCredit
|
|
|
|
|
*
|
|
|
|
|
* @package FireflyIII\Import\Converter
|
|
|
|
|
*/
|
2017-06-24 06:57:24 +02:00
|
|
|
class RabobankDebetCredit implements ConverterInterface
|
2016-07-16 07:58:25 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param $value
|
|
|
|
|
*
|
|
|
|
|
* @return int
|
|
|
|
|
*/
|
|
|
|
|
public function convert($value): int
|
|
|
|
|
{
|
|
|
|
|
Log::debug('Going to convert ', ['value' => $value]);
|
|
|
|
|
|
|
|
|
|
if ($value === 'D') {
|
2016-07-24 18:47:55 +02:00
|
|
|
Log::debug('Return -1');
|
|
|
|
|
|
2016-07-16 07:58:25 +02:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-24 18:47:55 +02:00
|
|
|
Log::debug('Return 1');
|
|
|
|
|
|
2016-07-16 07:58:25 +02:00
|
|
|
return 1;
|
|
|
|
|
}
|
2016-08-12 15:10:03 +02:00
|
|
|
}
|