Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"ext-dom": "*",
"ext-simplexml": "*",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"psr/log": "^1.0"
"psr/log": "^1.0",
"phpstan/phpstan": "^1.6"
},
"require-dev": {
"phpunit/phpunit": "^9.5.4"
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 8
paths:
- src

37 changes: 16 additions & 21 deletions src/Entity/RateInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

class RateInformation implements NodeInterface
{
/** @var bool */
private $negotiatedRatesIndicator;
private string $negotiatedRatesIndicator;

/** @var bool */
private $rateChartIndicator;
private string $rateChartIndicator;

/**
* @param null|object $attributes
Expand All @@ -36,8 +34,9 @@ public function __construct($attributes = null)
* @param null|DOMDocument $document
*
* @return DOMElement
* @throws \DOMException
*/
public function toNode(DOMDocument $document = null)
public function toNode(DOMDocument $document = null): DOMElement
{
if (null === $document) {
$document = new DOMDocument();
Expand All @@ -46,53 +45,49 @@ public function toNode(DOMDocument $document = null)
$node = $document->createElement('RateInformation');

if ($this->getNegotiatedRatesIndicator()) {
$node->appendChild($document->createElement('NegotiatedRatesIndicator'));
$node->appendChild($document->createElement('NegotiatedRatesIndicator', $this->getNegotiatedRatesIndicator()));
}

if ($this->getRateChartIndicator()) {
$node->appendChild($document->createElement('RateChartIndicator'));
$node->appendChild($document->createElement('RateChartIndicator', $this->getRateChartIndicator()));
}

return $node;
}

/**
* @return bool
* @return string
*/
public function getNegotiatedRatesIndicator()
public function getNegotiatedRatesIndicator(): string
{
return $this->negotiatedRatesIndicator;
}

/**
* @param $value
* @param string $value
*
* @return $this
* @return void
*/
public function setNegotiatedRatesIndicator($value)
public function setNegotiatedRatesIndicator(string $value): void
{
$this->negotiatedRatesIndicator = $value;

return $this;
}

/**
* @return bool
* @return string
*/
public function getRateChartIndicator()
public function getRateChartIndicator(): string
{
return $this->rateChartIndicator;
}

/**
* @param $value
* @param string $value
*
* @return $this
* @return void
*/
public function setRateChartIndicator($value)
public function setRateChartIndicator(string $value): void
{
$this->rateChartIndicator = $value;

return $this;
}
}
Loading