Skip to content

Commit

Permalink
Merge pull request #14 from thebiggive/CLA-25-exempt-fix
Browse files Browse the repository at this point in the history
CLA-25 – fix when `RegNo` is written
  • Loading branch information
alihejazi authored Apr 21, 2022
2 parents b932c2e + 673b6c3 commit 6382552
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ClaimingOrganisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ClaimingOrganisation
{
private $name = '';
private $hmrcRef = '';
private ?string $regulator;
private ?string $regulator = null;
private $regNo = '';
private $hasConnectedCharities = false;
private $connectedCharities = [];
Expand Down Expand Up @@ -51,7 +51,7 @@ public function setHmrcRef($value)
$this->hmrcRef = $value;
}

public function getRegulator()
public function getRegulator(): ?string
{
return $this->regulator;
}
Expand Down
6 changes: 5 additions & 1 deletion src/GiftAid.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,11 @@ protected function writeClaimStartData(XMLWriter $package, ClaimingOrganisation
} else {
$package->writeElement('OtherReg', $org->getRegulator());
}
$package->writeElement('RegNo', $org->getRegNo());

if ($org->getRegulator() !== null && !empty($org->getRegNo())) {
$package->writeElement('RegNo', $org->getRegNo());
}

$package->endElement(); # Regulator

$package->startElement('Repayment');
Expand Down

0 comments on commit 6382552

Please sign in to comment.