Skip to content

Commit

Permalink
small fix to ensure proper attributes writing
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgp committed Apr 20, 2024
1 parent 9731f37 commit a349e72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"config": {
"platform": {
"php": "8.2.16"
"php": "8.2.18"
},
"optimize-autoloader": true,
"sort-packages": true
Expand Down
17 changes: 10 additions & 7 deletions source/TraitBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

trait TraitBasic
{

protected array $arraySettings = [];
protected array $arrayProcessing = [];

Expand All @@ -25,7 +24,7 @@ private function getCommentsFromFileAsArray(): array
return $this->getJsonFromFile('config/ElectronicInvoiceComments.json');
}

private function getElements(\SimpleXMLElement|null $arrayIn): array
private function getElements(\SimpleXMLElement | null $arrayIn): array
{
$arrayToReturn = [];
if (!is_null($arrayIn)) {
Expand All @@ -43,7 +42,7 @@ private function getElements(\SimpleXMLElement|null $arrayIn): array
return $arrayToReturn;
}

private function getElementSingle(\SimpleXMLElement|null $value)
private function getElementSingle(\SimpleXMLElement | null $value)
{
$arrayToReturn = [];
if (!is_null($value)) {
Expand All @@ -52,7 +51,9 @@ private function getElementSingle(\SimpleXMLElement|null $value)
} else {
$arrayToReturn['value'] = $value->__toString();
foreach ($value->attributes() as $keyA => $valueA) {
if (!str_ends_with($valueA, ':CommonAggregateComponents-2') && str_ends_with($valueA, ':CommonBasicComponents-2')) {
if (str_ends_with($valueA, ':CommonAggregateComponents-2')) {
// nothing
} else {
$arrayToReturn[$keyA] = $valueA->__toString();
}
}
Expand Down Expand Up @@ -108,7 +109,7 @@ private function getMultipleElementsByKey(\SimpleXMLElement $arrayData): array
return $arrayOutput;
}

private function getMultipleElementsStandard(array|\SimpleXMLElement $arrayIn): array
private function getMultipleElementsStandard(array | \SimpleXMLElement $arrayIn): array
{
$arrayToReturn = [];
$intLineNo = 0;
Expand All @@ -121,7 +122,9 @@ private function getMultipleElementsStandard(array|\SimpleXMLElement $arrayIn):
} else {
$arrayToReturn[$intLineStr][$key2]['value'] = $value2->__toString();
foreach ($value2->attributes() as $keyA => $valueA) {
if (!str_ends_with($valueA, ':CommonAggregateComponents-2') && str_ends_with($valueA, ':CommonBasicComponents-2')) {
if (str_ends_with($valueA, ':CommonAggregateComponents-2')) {
// nothing
} else {
$arrayToReturn[$intLineStr][$key2][$keyA] = $valueA->__toString();
}
}
Expand All @@ -139,7 +142,7 @@ private function getProcessingDetails(): void
$this->arrayProcessing = $this->getJsonFromFile('config/ElectronicInvoiceProcessingDetails.json');
}

public function getRightMethod(string $existingFunction, $givenParameters = null): array|string
public function getRightMethod(string $existingFunction, $givenParameters = null): array | string
{
try {
if (is_array($givenParameters)) {
Expand Down

0 comments on commit a349e72

Please sign in to comment.