Fixes Deprication

This commit is contained in:
Thomas Peterson 2025-06-11 09:50:40 +02:00
parent df237473cb
commit f7e6247427
4 changed files with 9 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -50,16 +50,16 @@ class CalcValues
public function calc(): float
{
return $this->calcRec(0, $this->article->getOptions());
return $this->calcRec($this->article->getOptions(), 0);
}
private function calcRec($price = 0, $options): float
private function calcRec($options, $price = 0): float
{
foreach ($options as $option) {
if ($option instanceof Row) {
foreach($option->getColumns() as $col) {
$price = $this->calcRec($price, $col->getOptions());
$price = $this->calcRec($col->getOptions(), $price);
}
}
if ($option instanceof Select || $option instanceof Checkbox) {

View File

@ -37,15 +37,15 @@ class Valid
public function perform($withFormel = true): void
{
$this->validRec($withFormel, $this->article->getOptions());
$this->validRec($this->article->getOptions(), $withFormel);
}
private function validRec($withFormel = true, \ArrayIterator $options): void
private function validRec(\ArrayIterator $options, $withFormel = true): void
{
foreach($options as $option) {
if($option instanceof Row) {
foreach($option->getColumns() as $col) {
$this->validRec($withFormel, $col->getOptions());
$this->validRec($col->getOptions(), $withFormel);
}
}
if($option instanceof Input) {

View File

@ -8,6 +8,7 @@ class Opt
{
protected $element;
protected \SimpleXMLElement $node;
public function __construct(\SimpleXMLElement $node)
{
@ -28,4 +29,4 @@ class Opt
return $this->element;
}
}
}