feat(php): add PHP 8.4 version of the goban challenge#12
Open
decima wants to merge 1 commit into
Open
Conversation
Scaffold under php/ with Composer + PHPUnit 11. Status enum and Goban class with getStatus implemented; isTaken left to implement. Test suite mirrors the Go/Python cases via PHPUnit data providers.
elbaz-amin
approved these changes
May 19, 2026
elbaz-amin
left a comment
There was a problem hiding this comment.
Globally this goban look fine, same as for others language. Maybe one question, what's the relevance of it in today area with AI that can solve it in the blink of an eye?
Comment on lines
+14
to
+19
| public static function provideTestCases(): array | ||
| { | ||
| return [ | ||
| 'white_is_taken_when_surrounded_by_black' => [ | ||
| ['.#.', '#o#', '.#.'], 1, 1, true, | ||
| ], |
There was a problem hiding this comment.
Generally, when using dataProvider it's preferable to used Generator which are better in term of performance and memory consumption and improve readability.
Suggested change
| public static function provideTestCases(): array | |
| { | |
| return [ | |
| 'white_is_taken_when_surrounded_by_black' => [ | |
| ['.#.', '#o#', '.#.'], 1, 1, true, | |
| ], | |
| public static function provideTestCases(): \Generator | |
| { | |
| yield 'white_is_taken_when_surrounded_by_black' => [['.#.', '#o#', '.#.'], 1, 1, true]; | |
| ... |
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.
Summary
php/with a PHP 8.4 scaffold using Composer + PHPUnit 11Statusenum andGoban::getStatus()implemented;Goban::isTaken()left to implement#[DataProvider]— mirrors Go/Python test cases (12 cases)vendor/and.phpunit.cache/gitignoredTest plan
cd php && composer install && ./vendor/bin/phpunit— 12 errors expected (scaffold)isTakenis implemented, all 12 tests should pass