Fixes
This commit is contained in:
parent
0ca9888d0a
commit
872706857b
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
||||||
<coverage line-rate="0.73896229455366" branch-rate="0" lines-covered="2293" lines-valid="3103" branches-covered="0" branches-valid="0" complexity="1359" version="0.4" timestamp="1752863878">
|
<coverage line-rate="0.73399487836108" branch-rate="0" lines-covered="2293" lines-valid="3124" branches-covered="0" branches-valid="0" complexity="1366" version="0.4" timestamp="1753352747">
|
||||||
<sources>
|
<sources>
|
||||||
<source>/home/thomas/projekte/calc/src</source>
|
<source>/home/thomas/projekte/calc/src</source>
|
||||||
</sources>
|
</sources>
|
||||||
@ -5742,9 +5742,9 @@
|
|||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
</package>
|
</package>
|
||||||
<package name="Option/Parser/Headline.php" line-rate="0.92307692307692" branch-rate="0" complexity="6">
|
<package name="Option/Parser/Headline.php" line-rate="0.57142857142857" branch-rate="0" complexity="10">
|
||||||
<classes>
|
<classes>
|
||||||
<class name="PSC\Library\Calc\Option\Parser\Headline" filename="Option/Parser/Headline.php" line-rate="0.92307692307692" branch-rate="0" complexity="6">
|
<class name="PSC\Library\Calc\Option\Parser\Headline" filename="Option/Parser/Headline.php" line-rate="0.57142857142857" branch-rate="0" complexity="10">
|
||||||
<methods>
|
<methods>
|
||||||
<method name="__construct" signature="" line-rate="1" branch-rate="0" complexity="1">
|
<method name="__construct" signature="" line-rate="1" branch-rate="0" complexity="1">
|
||||||
<lines>
|
<lines>
|
||||||
@ -5758,13 +5758,25 @@
|
|||||||
<line number="22" hits="2"/>
|
<line number="22" hits="2"/>
|
||||||
<line number="25" hits="2"/>
|
<line number="25" hits="2"/>
|
||||||
<line number="26" hits="2"/>
|
<line number="26" hits="2"/>
|
||||||
<line number="30" hits="2"/>
|
<line number="29" hits="2"/>
|
||||||
<line number="31" hits="0"/>
|
<line number="30" hits="0"/>
|
||||||
|
<line number="33" hits="2"/>
|
||||||
<line number="34" hits="2"/>
|
<line number="34" hits="2"/>
|
||||||
<line number="35" hits="2"/>
|
<line number="35" hits="2"/>
|
||||||
<line number="36" hits="2"/>
|
<line number="36" hits="2"/>
|
||||||
<line number="37" hits="2"/>
|
<line number="39" hits="2"/>
|
||||||
<line number="40" hits="2"/>
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method name="parseJSON" signature="" line-rate="0" branch-rate="0" complexity="4">
|
||||||
|
<lines>
|
||||||
|
<line number="44" hits="0"/>
|
||||||
|
<line number="46" hits="0"/>
|
||||||
|
<line number="47" hits="0"/>
|
||||||
|
<line number="50" hits="0"/>
|
||||||
|
<line number="51" hits="0"/>
|
||||||
|
<line number="52" hits="0"/>
|
||||||
|
<line number="53" hits="0"/>
|
||||||
|
<line number="56" hits="0"/>
|
||||||
</lines>
|
</lines>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
@ -5775,13 +5787,21 @@
|
|||||||
<line number="22" hits="2"/>
|
<line number="22" hits="2"/>
|
||||||
<line number="25" hits="2"/>
|
<line number="25" hits="2"/>
|
||||||
<line number="26" hits="2"/>
|
<line number="26" hits="2"/>
|
||||||
<line number="30" hits="2"/>
|
<line number="29" hits="2"/>
|
||||||
<line number="31" hits="0"/>
|
<line number="30" hits="0"/>
|
||||||
|
<line number="33" hits="2"/>
|
||||||
<line number="34" hits="2"/>
|
<line number="34" hits="2"/>
|
||||||
<line number="35" hits="2"/>
|
<line number="35" hits="2"/>
|
||||||
<line number="36" hits="2"/>
|
<line number="36" hits="2"/>
|
||||||
<line number="37" hits="2"/>
|
<line number="39" hits="2"/>
|
||||||
<line number="40" hits="2"/>
|
<line number="44" hits="0"/>
|
||||||
|
<line number="46" hits="0"/>
|
||||||
|
<line number="47" hits="0"/>
|
||||||
|
<line number="50" hits="0"/>
|
||||||
|
<line number="51" hits="0"/>
|
||||||
|
<line number="52" hits="0"/>
|
||||||
|
<line number="53" hits="0"/>
|
||||||
|
<line number="56" hits="0"/>
|
||||||
</lines>
|
</lines>
|
||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
@ -7268,24 +7288,58 @@
|
|||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
</package>
|
</package>
|
||||||
<package name="Option/Type/Headline.php" line-rate="1" branch-rate="0" complexity="2">
|
<package name="Option/Type/Headline.php" line-rate="0.13333333333333" branch-rate="0" complexity="5">
|
||||||
<classes>
|
<classes>
|
||||||
<class name="PSC\Library\Calc\Option\Type\Headline" filename="Option/Type/Headline.php" line-rate="1" branch-rate="0" complexity="2">
|
<class name="PSC\Library\Calc\Option\Type\Headline" filename="Option/Type/Headline.php" line-rate="0.13333333333333" branch-rate="0" complexity="5">
|
||||||
<methods>
|
<methods>
|
||||||
<method name="setVariant" signature="int $variant" line-rate="1" branch-rate="0" complexity="1">
|
<method name="setVariant" signature="int $variant" line-rate="1" branch-rate="0" complexity="1">
|
||||||
<lines>
|
<lines>
|
||||||
<line number="12" hits="2"/>
|
<line number="13" hits="2"/>
|
||||||
</lines>
|
</lines>
|
||||||
</method>
|
</method>
|
||||||
<method name="getVariant" signature="" line-rate="1" branch-rate="0" complexity="1">
|
<method name="getVariant" signature="" line-rate="1" branch-rate="0" complexity="1">
|
||||||
<lines>
|
<lines>
|
||||||
<line number="15" hits="2"/>
|
<line number="18" hits="2"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method name="generateXML" signature="" line-rate="0" branch-rate="0" complexity="2">
|
||||||
|
<lines>
|
||||||
|
<line number="23" hits="0"/>
|
||||||
|
<line number="25" hits="0"/>
|
||||||
|
<line number="26" hits="0"/>
|
||||||
|
<line number="27" hits="0"/>
|
||||||
|
<line number="28" hits="0"/>
|
||||||
|
<line number="29" hits="0"/>
|
||||||
|
<line number="30" hits="0"/>
|
||||||
|
<line number="31" hits="0"/>
|
||||||
|
<line number="33" hits="0"/>
|
||||||
|
</lines>
|
||||||
|
</method>
|
||||||
|
<method name="generateJson" signature="" line-rate="0" branch-rate="0" complexity="1">
|
||||||
|
<lines>
|
||||||
|
<line number="38" hits="0"/>
|
||||||
|
<line number="39" hits="0"/>
|
||||||
|
<line number="40" hits="0"/>
|
||||||
|
<line number="41" hits="0"/>
|
||||||
</lines>
|
</lines>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
<lines>
|
<lines>
|
||||||
<line number="12" hits="2"/>
|
<line number="13" hits="2"/>
|
||||||
<line number="15" hits="2"/>
|
<line number="18" hits="2"/>
|
||||||
|
<line number="23" hits="0"/>
|
||||||
|
<line number="25" hits="0"/>
|
||||||
|
<line number="26" hits="0"/>
|
||||||
|
<line number="27" hits="0"/>
|
||||||
|
<line number="28" hits="0"/>
|
||||||
|
<line number="29" hits="0"/>
|
||||||
|
<line number="30" hits="0"/>
|
||||||
|
<line number="31" hits="0"/>
|
||||||
|
<line number="33" hits="0"/>
|
||||||
|
<line number="38" hits="0"/>
|
||||||
|
<line number="39" hits="0"/>
|
||||||
|
<line number="40" hits="0"/>
|
||||||
|
<line number="41" hits="0"/>
|
||||||
</lines>
|
</lines>
|
||||||
</class>
|
</class>
|
||||||
</classes>
|
</classes>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Option\Parser;
|
namespace PSC\Library\Calc\Option\Parser;
|
||||||
|
|
||||||
use PSC\Library\Calc\General\Parser\EdgeCollectionContainer;
|
use PSC\Library\Calc\General\Parser\EdgeCollectionContainer;
|
||||||
@ -6,7 +7,6 @@ use PSC\Library\Calc\Option\Type\Headline as PSCHeadline;
|
|||||||
|
|
||||||
class Headline extends Base
|
class Headline extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $element;
|
protected $element;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@ -26,7 +26,6 @@ class Headline extends Base
|
|||||||
$this->element->setVariant((int) $this->node['variant']);
|
$this->element->setVariant((int) $this->node['variant']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->element->getDefault() != null) {
|
if ($this->element->getDefault() != null) {
|
||||||
$this->element->setValue($this->element->getDefault());
|
$this->element->setValue($this->element->getDefault());
|
||||||
}
|
}
|
||||||
@ -40,4 +39,20 @@ class Headline extends Base
|
|||||||
return $this->element;
|
return $this->element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function parseJSON(): PSCHeadline
|
||||||
|
{
|
||||||
|
parent::parseJson();
|
||||||
|
|
||||||
|
if ($this->json['variant']) {
|
||||||
|
$this->element->setVariant((int) $this->json['variant']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($this->json['dependencys']) && count($this->json['dependencys']) > 0) {
|
||||||
|
$edgeCollectionContainerParser = new EdgeCollectionContainer();
|
||||||
|
$edgeCollectionContainerParser->fromJson($this->json['dependencys']);
|
||||||
|
$this->element->setEdgesCollectionContainer($edgeCollectionContainerParser->parseJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->element;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PSC\Library\Calc\Option\Type;
|
namespace PSC\Library\Calc\Option\Type;
|
||||||
|
|
||||||
class Headline extends Base
|
class Headline extends Base
|
||||||
{
|
{
|
||||||
|
|
||||||
private int $variant = 1;
|
private int $variant = 1;
|
||||||
|
|
||||||
public $type = 'headline';
|
public $type = 'headline';
|
||||||
|
|
||||||
public function setVariant(int $variant):void {
|
public function setVariant(int $variant): void
|
||||||
|
{
|
||||||
$this->variant = $variant;
|
$this->variant = $variant;
|
||||||
}
|
}
|
||||||
public function getVariant():int {
|
|
||||||
|
public function getVariant(): int
|
||||||
|
{
|
||||||
return $this->variant;
|
return $this->variant;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function generateXML(): array
|
||||||
|
{
|
||||||
|
$tmp = [];
|
||||||
|
|
||||||
|
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
||||||
|
'default' => $this->getDefault(),
|
||||||
|
]]);
|
||||||
|
if ($this->getVariant()) {
|
||||||
|
$tmp = array_merge_recursive($tmp, ['_attributes' => [
|
||||||
|
'variant' => $this->getVariant(),
|
||||||
|
]]);
|
||||||
|
}
|
||||||
|
return array_merge_recursive($tmp, parent::generateXML());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateJson(): \stdClass
|
||||||
|
{
|
||||||
|
$obj = parent::generateJson();
|
||||||
|
$obj->variant = $this->getVariant();
|
||||||
|
$obj->type = 6;
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user