49 lines
1.2 KiB
PHP
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;
|
|
}
|
|
} |