-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
110 additions
and
41 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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace WebmozartAssertBug118; | ||
|
||
use DateTime; | ||
use Webmozart\Assert\Assert; | ||
|
||
function test(float $a, DateTime $b): void | ||
{ | ||
Assert::range($a, 0, 1); | ||
Assert::range($b, 123456789, 9876543321); | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace WebmozartAssertBug119; | ||
|
||
use DateTime; | ||
use Webmozart\Assert\Assert; | ||
|
||
function test(float $a, float $b, float $c, float $d, DateTime $e): void | ||
{ | ||
Assert::greaterThan($a, 0); | ||
Assert::greaterThanEq($b, 0); | ||
Assert::lessThan($c, 0); | ||
Assert::lessThanEq($d, 0); | ||
Assert::greaterThanEq($e, 639828000); | ||
} |
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,22 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace WebmozartAssertBug130; | ||
|
||
use Webmozart\Assert\Assert; | ||
|
||
class Bug130 | ||
{ | ||
/** @var array<int, array{id: string, num_order: string}> */ | ||
protected $orders = []; | ||
|
||
public function setOrders(array $orders): self | ||
{ | ||
Assert::allCount($orders, 2); | ||
Assert::allKeyExists($orders, 'id'); | ||
Assert::allKeyExists($orders, 'num_order'); | ||
|
||
$this->orders = $orders; | ||
|
||
return $this; | ||
} | ||
} |
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