Initial commit
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace App\Helper\DataNeed;
|
||||
|
||||
use App\Logic\Crypto\MainObject;
|
||||
|
||||
final class CryptoValues
|
||||
{
|
||||
private static array $values = [
|
||||
"values" => ["Wartość","Values"],
|
||||
"currency" => ["Currency", "Waluta"],
|
||||
"date" => ["Data operacji"],
|
||||
"desc" => ["Rodzaj"]
|
||||
];
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user