-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from RobinGeuze/addMatchesSupport
Add support for matches field on transactions
- Loading branch information
Showing
6 changed files
with
249 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace PhpTwinfield\Transactions; | ||
|
||
use Money\Money; | ||
|
||
class MatchLine | ||
{ | ||
/** @var string */ | ||
private $code; | ||
|
||
/** @var int */ | ||
private $number; | ||
|
||
/** @var int */ | ||
private $line; | ||
|
||
/** @var Money */ | ||
private $matchValue; | ||
|
||
public function __construct( | ||
string $code, | ||
int $number, | ||
int $line, | ||
Money $matchValue | ||
) | ||
{ | ||
$this->code = $code; | ||
$this->number = $number; | ||
$this->line = $line; | ||
$this->matchValue = $matchValue; | ||
} | ||
|
||
public function getCode(): string | ||
{ | ||
return $this->code; | ||
} | ||
|
||
public function getNumber(): int | ||
{ | ||
return $this->number; | ||
} | ||
|
||
public function getLine(): int | ||
{ | ||
return $this->line; | ||
} | ||
|
||
public function getMatchValue(): Money | ||
{ | ||
return $this->matchValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace PhpTwinfield\Transactions; | ||
|
||
use DateTimeInterface; | ||
use Money\Money; | ||
use PhpTwinfield\Enums\Destiny; | ||
|
||
class MatchSet | ||
{ | ||
/** @var Destiny */ | ||
private $status; | ||
|
||
/** @var DateTimeInterface */ | ||
private $matchDate; | ||
|
||
/** @var Money */ | ||
private $matchValue; | ||
|
||
/** @var MatchLine[] */ | ||
private $matchLines; | ||
|
||
/** | ||
* @param Destiny $status | ||
* @param DateTimeInterface $matchDate | ||
* @param Money $matchValue | ||
* @param MatchLine[] $matchLines | ||
*/ | ||
public function __construct( | ||
Destiny $status, | ||
DateTimeInterface $matchDate, | ||
Money $matchValue, | ||
array $matchLines | ||
) | ||
{ | ||
$this->status = $status; | ||
$this->matchDate = $matchDate; | ||
$this->matchValue = $matchValue; | ||
$this->matchLines = $matchLines; | ||
} | ||
|
||
public function getStatus(): Destiny | ||
{ | ||
return $this->status; | ||
} | ||
|
||
public function getMatchDate(): DateTimeInterface | ||
{ | ||
return $this->matchDate; | ||
} | ||
|
||
public function getMatchValue(): Money | ||
{ | ||
return $this->matchValue; | ||
} | ||
|
||
/** | ||
* @return MatchLine[] | ||
*/ | ||
public function getMatchLines(): array | ||
{ | ||
return $this->matchLines; | ||
} | ||
} |
Oops, something went wrong.