upgrade symfony

This commit is contained in:
2026-04-13 13:19:18 +02:00
parent ce7fc07aa5
commit 84ad29d0a0
24 changed files with 2680 additions and 2611 deletions
@@ -12,7 +12,7 @@ class DividendsSummary
private array $sheetData=[];
/** @var XMLReader|array $sheetData */
private array $xmlData=[];
private Currency $currencyObj;
private readonly Currency $currencyObj;
/** @var array|DividendsData $error */
private ?array $errorDividend=null;
private ?array $errorString=null;
+4 -4
View File
@@ -14,7 +14,7 @@ class ExanteSheet extends SheetDataAll
continue;
}
foreach ($rawDatum as $key => $value) {
$value = strtolower($value);
$value = strtolower((string) $value);
if (str_contains($value, "comment")) {
$commentKey = $key;
}
@@ -28,15 +28,15 @@ class ExanteSheet extends SheetDataAll
if ($index<2) {
continue;
}
$operationType = strtolower($rawDatum[$operationKey]);
$operationType = strtolower((string) $rawDatum[$operationKey]);
if (!str_contains($operationType,"dividend")) {
continue;
}
$comment = $rawDatum[$commentKey];
if (!str_contains($comment, "dividend")) {
if (!str_contains((string) $comment, "dividend")) {
continue;
}
$separate = explode(" ",$comment);
$separate = explode(" ",(string) $comment);
$tax = intval(str_replace(["(","-","%",")"],"",$separate[16]));
$value = floatval(str_replace(["(",")"],"",$separate[10]));
$date = new \DateTime($separate[3]);
+3 -3
View File
@@ -39,7 +39,7 @@ class IbkrSheet extends SheetDataAll
}
}
$test[$row['groupId']][] = $row['amount'];
if (str_contains($row['type'], "Dividend")) {
if (str_contains((string) $row['type'], "Dividend")) {
$dividendArr[$row['groupId']] = $row;
} else {
if (!isset($taxArr[$row['groupId']])) {
@@ -61,7 +61,7 @@ class IbkrSheet extends SheetDataAll
$taxPercentage = 19;
}
$separate = explode(" ", $dividend['description']);
$separate = explode(" ", (string) $dividend['description']);
$perShare = floatval($separate[4]);
if (!$perShare) {
$perShare = floatval($separate[5]);
@@ -69,7 +69,7 @@ class IbkrSheet extends SheetDataAll
if (!$perShare) {
continue;
}
$date = explode(";", $dividend['date'])[0];
$date = explode(";", (string) $dividend['date'])[0];
if (substr_count($date, "-") !== 2) {
$date = substr($date, 0, 4) . "-" . substr($date, 4, 2) . "-" . substr($date, 6, 2);
}
+3 -3
View File
@@ -94,7 +94,7 @@ class SheetData extends SheetDataAll
$count++;
return $ret;
}
if (in_array(mb_substr($data, 0, 2), ['CA', 'US', 'IE', 'GB']) && intval(mb_substr($data, 2, 1))>0) {
if (in_array(mb_substr((string) $data, 0, 2), ['CA', 'US', 'IE', 'GB']) && intval(mb_substr((string) $data, 2, 1))>0) {
$count = &$setDatas['data'];
$ret = "isin";
if ($count > 0) {
@@ -106,7 +106,7 @@ class SheetData extends SheetDataAll
if (in_array($data, Currency::$currencies)) {
return "currency";
}
if (count(explode(".", $data)) === 3 || count(explode("-", $data)) === 3) {
if (count(explode(".", (string) $data)) === 3 || count(explode("-", (string) $data)) === 3) {
return "date";
}
@@ -118,7 +118,7 @@ class SheetData extends SheetDataAll
$ret = -1;
foreach ($this->takeColumnNames() as $index => $takeColumnName) {
if (strpos($takeColumnName,"DATE") !== false || strpos($takeColumnName,"DATA") !== false) {
if (str_contains((string) $takeColumnName,"DATE") || str_contains((string) $takeColumnName,"DATA")) {
$ret = $index;
break;
}
+1 -3
View File
@@ -12,16 +12,14 @@ abstract class SheetDataAll
*/
protected array $data = [];
protected array $dataNotCalculate = [];
private array $rawData;
/**
* Assign raw data to field, then create array of DividendsData
*
* @param array $rawData
*/
public function __construct(array $rawData)
public function __construct(private readonly array $rawData)
{
$this->rawData = $rawData;
$this->countData = count($this->rawData) - 1;
$this->data = $this->takeData();
}
+1 -1
View File
@@ -55,7 +55,7 @@ class XMLReader
$obj->setCurrency($value);
}
if ($key === "payDate") {
$tmp = str_split($value, 4);
$tmp = str_split((string) $value, 4);
$y=$tmp[0];
$tmp = str_split($tmp[1],2);
$d = $tmp[1];