Skip to content

Commit

Permalink
Allow sanitizer object to be lazy loaded.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Apr 4, 2018
1 parent d7544da commit bd0e8a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require": {
"php": ">=7.1",
"jomweb/ringgit": "^1.0.3",
"laravie/codex": "^1.6",
"laravie/codex": "^1.6.1",
"php-http/multipart-stream-builder": "^1.0"
},
"require-dev": {
Expand Down
12 changes: 6 additions & 6 deletions src/Sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public function __construct(array $casters = [])
$datetime = $casters['datetime'] ?? Casts\DateTime::class;

$this->casts = [
'total' => new $money(),
'amount' => new $money(),
'due_at' => new $datetime(),
'paid_amount' => new $money(),
'paid_at' => new $datetime(),
'total' => $money,
'amount' => $money,
'due_at' => $datetime,
'paid_amount' => $money,
'paid_at' => $datetime,
'split_payment' => [
'fixed_cut' => new $money(),
'fixed_cut' => $money,
],
];
}
Expand Down
1 change: 1 addition & 0 deletions tests/Base/BillTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function it_can_show_existing_bill()
$bill = $response->toArray();

$this->assertInstanceOf(MYR::class, $bill['amount']);
$this->assertSame('2.00', $bill['amount']->amount());
$this->assertSame('inbmmepb', $bill['collection_id']);
}

Expand Down

0 comments on commit bd0e8a4

Please sign in to comment.