feat: all と none を追加する - #80
Open
Javakky wants to merge 2 commits into
Open
Conversation
Javakky
force-pushed
the
javakky/all-none
branch
from
July 27, 2026 07:16
9a58b9e to
ac01e3d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要(What / Why)
既存の
anyと対になるall(全件成立) とnone(1 件も成立しない) を追加します。変更点
src/all.php— PHP 8.4 のarray_all()に委譲。空配列は vacuous truth でtruesrc/none.php—!any($input, $callback)。空配列はtruetests/AllTest.php/tests/NoneTest.php— 各 7 ケースcomposer.jsonのautoload.filesに 2 件追加動作確認
all([], fn () => false)→true/none([1, 2], fn ($v) => $v > 5)→truevendor/bin/php-cs-fixer fix --dry-run --diff/vendor/bin/phpstan analyse -c phpstan.neon/vendor/bin/phpunit testsOK (111 tests, 120 assertions)/ PHPStan level 10[OK] No errors/ CS FixerFixed 0 of 33 files補足(任意)
anyに揃えて$callbackにしました (filter/collect/chunk_byも同じ)noneはanyの否定なので 1 行委譲にして、any/all/noneの 3 関数を同じ層に並べました。短絡の保証もarray_any()/array_all()の 1 箇所に集約されますmatchの分岐に使う形で実質的に検証していますCloses #61
Closes #62
🤖 Generated with Claude Code