diff --git a/VERSION b/VERSION index 0823a1f..56e670d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2401.40206 +0.2402.62138 diff --git a/composer.lock b/composer.lock index 5bb0506..9ad8581 100644 --- a/composer.lock +++ b/composer.lock @@ -68,25 +68,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -94,7 +96,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -118,9 +120,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-01-07T17:17:35+00:00" }, { "name": "phar-io/manifest", @@ -235,16 +237,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.50", + "version": "1.10.57", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1627b1d03446904aaa77593f370c5201d2ecc34e", + "reference": "1627b1d03446904aaa77593f370c5201d2ecc34e", "shasum": "" }, "require": { @@ -293,7 +295,7 @@ "type": "tidelift" } ], - "time": "2023-12-13T10:59:42+00:00" + "time": "2024-01-24T11:51:34+00:00" }, { "name": "phpunit/php-code-coverage", @@ -618,16 +620,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.5", + "version": "10.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856" + "reference": "50b8e314b6d0dd06521dc31d1abffa73f25f850c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ed21115d505b4b4f7dc7b5651464e19a2c7f7856", - "reference": "ed21115d505b4b4f7dc7b5651464e19a2c7f7856", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50b8e314b6d0dd06521dc31d1abffa73f25f850c", + "reference": "50b8e314b6d0dd06521dc31d1abffa73f25f850c", "shasum": "" }, "require": { @@ -699,7 +701,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.10" }, "funding": [ { @@ -715,7 +717,7 @@ "type": "tidelift" } ], - "time": "2023-12-27T15:13:52+00:00" + "time": "2024-02-04T09:07:51+00:00" }, { "name": "sebastian/cli-parser", diff --git a/src/Data/DbResultIterator.php b/src/Data/DbResultIterator.php new file mode 100644 index 0000000..a212bac --- /dev/null +++ b/src/Data/DbResultIterator.php @@ -0,0 +1,56 @@ +current; + } + + public function key(): mixed { + return spl_object_id($this->current); + } + + private function moveNext(): void { + if($this->wasValid = $this->result->next()) + $this->current = ($this->construct)($this->result); + } + + public function next(): void { + $this->moveNext(); + } + + public function rewind(): void { + $this->moveNext(); + } + + public function valid(): bool { + return $this->wasValid; + } +} diff --git a/src/Data/DbResultTrait.php b/src/Data/DbResultTrait.php index 1e18d87..966e2cc 100644 --- a/src/Data/DbResultTrait.php +++ b/src/Data/DbResultTrait.php @@ -1,10 +1,13 @@ getValue($index); @@ -37,4 +40,8 @@ trait DbResultTrait { public function getBooleanOrNull(int|string $index): ?bool { return $this->isNull($index) ? null : ($this->getInteger($index) !== 0); } + + public function getIterator(callable $construct): DbResultIterator { + return new DbResultIterator($this, $construct); + } } diff --git a/src/Data/IDbResult.php b/src/Data/IDbResult.php index 5dcac9e..012b25b 100644 --- a/src/Data/IDbResult.php +++ b/src/Data/IDbResult.php @@ -1,7 +1,7 @@