Files
taxes/project/src/Helper/DataNeed/CryptoValues.php
T
2022-04-20 15:11:37 +02:00

49 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Helper\DataNeed;
use App\Logic\Crypto\MainObject;
final class CryptoValues
{
private static array $values = [
"values" => ["Wartość","Values","Amount"],
"currency" => ["Currency", "Waluta"],
"date" => ["Data operacji","Date(UTC)"],
"desc" => ["Rodzaj"],
"price" => ["Price"],
"transactionType" => ["Type"],
"market" => ["Market"],
"realValue" => ["Total"]
];
public static function isValue(string $type, string $text) : bool
{
if (!isset(self::$values[$type])) {
return false;
}
$ret = false;
foreach (self::$values[$type] as $value) {
if (strpos($text,$value) !== false) {
$ret = true;
break;
}
}
return $ret;
}
public static function isInOut(MainObject $mainObject) : bool
{
$arr = [
"Wypłata środków","Blokada środków","Wpłata na rachunek"
];
$ret = false;
foreach ($arr as $item) {
if ($mainObject->getDesc() === $item) {
$ret = true;
break;
}
}
return $ret;
}
}