1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-29 08:49:50 +02:00

used PHP 7.1 features

- ::class
- ... argument unpacking
- removed call_user_func
- operator ??
- list()
- short <?=
This commit is contained in:
David Grudl
2017-06-09 12:21:23 +02:00
parent 750d70c77a
commit 3891625cd1
27 changed files with 100 additions and 109 deletions

View File

@@ -13,7 +13,7 @@ class MockResult extends Dibi\Result
function test($row)
{
$normalize = new ReflectionMethod('Dibi\Result', 'normalize');
$normalize = new ReflectionMethod(Dibi\Result::class, 'normalize');
$normalize->setAccessible(TRUE);
$normalize->invokeArgs($this, [&$row]);
return $row;
@@ -164,7 +164,7 @@ test(function () {
Assert::same(['col' => NULL], $result->test(['col' => NULL]));
Assert::exception(function () use ($result) {
$result->test(['col' => TRUE]);
}, 'Exception');
}, Exception::class);
Assert::same(['col' => NULL], $result->test(['col' => FALSE]));
Assert::same(['col' => NULL], $result->test(['col' => '']));
@@ -183,7 +183,7 @@ test(function () {
Assert::same(['col' => NULL], $result->test(['col' => NULL]));
Assert::exception(function () use ($result) {
$result->test(['col' => TRUE]);
}, 'Exception');
}, Exception::class);
Assert::same(['col' => NULL], $result->test(['col' => FALSE]));
Assert::same(['col' => NULL], $result->test(['col' => '']));
@@ -201,7 +201,7 @@ test(function () {
Assert::same(['col' => NULL], $result->test(['col' => NULL]));
Assert::exception(function () use ($result) {
$result->test(['col' => TRUE]);
}, 'Exception');
}, Exception::class);
Assert::same(['col' => NULL], $result->test(['col' => FALSE]));
Assert::same(['col' => NULL], $result->test(['col' => '']));
@@ -217,7 +217,7 @@ test(function () {
Assert::same(['col' => NULL], $result->test(['col' => NULL]));
Assert::exception(function () use ($result) {
$result->test(['col' => TRUE]);
}, 'Exception');
}, Exception::class);
Assert::same(['col' => NULL], $result->test(['col' => FALSE]));
Assert::same(['col' => NULL], $result->test(['col' => '']));