Skip to content

Commit 09c4bb6

Browse files
committed
Added accesses to the primitive value of the TaxIdNumber
1 parent 405d68a commit 09c4bb6

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ This changelog references the relevant changes done between versions.
55
To get the diff for a specific change, go to https://github.com/LIN3S/SharedKernel/commit/XXX where XXX is the change hash
66
To get the diff between two versions, go to https://github.com/LIN3S/SharedKernel/compare/v0.6.0...v0.7.0
77

8+
* 0.7.1
9+
* Added accesses to the primitive value of the TaxIdNumber.
810
* 0.7.0
911
* Added TaxIdNumber value object.
1012
* 0.6.0

src/LIN3S/SharedKernel/Domain/Model/TaxIdNumber/TaxIdNumber.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,19 @@ public static function fromSpanishDni(string $dni) : self
6262

6363
return new self($dni);
6464
}
65+
66+
public function number() : string
67+
{
68+
return $this->tin;
69+
}
70+
71+
public function equals(TaxIdNumber $tin) : bool
72+
{
73+
return $this->tin === $tin->number();
74+
}
75+
76+
public function __toString() : string
77+
{
78+
return (string) $this->tin;
79+
}
6580
}

0 commit comments

Comments
 (0)