Skip to content

feat(php): add PHP 8.4 version of the goban challenge#12

Open
decima wants to merge 1 commit into
feat/add-gofrom
feat/add-php
Open

feat(php): add PHP 8.4 version of the goban challenge#12
decima wants to merge 1 commit into
feat/add-gofrom
feat/add-php

Conversation

@decima
Copy link
Copy Markdown
Contributor

@decima decima commented May 18, 2026

Summary

  • Adds php/ with a PHP 8.4 scaffold using Composer + PHPUnit 11
  • Status enum and Goban::getStatus() implemented; Goban::isTaken() left to implement
  • Test suite via #[DataProvider] — mirrors Go/Python test cases (12 cases)
  • vendor/ and .phpunit.cache/ gitignored

Test plan

  • cd php && composer install && ./vendor/bin/phpunit — 12 errors expected (scaffold)
  • Once isTaken is implemented, all 12 tests should pass

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.
@decima decima marked this pull request as ready for review May 18, 2026 15:40
@elbaz-amin elbaz-amin self-requested a review May 19, 2026 07:10
Copy link
Copy Markdown

@elbaz-amin elbaz-amin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread php/tests/GobanTest.php
Comment on lines +14 to +19
public static function provideTestCases(): array
{
return [
'white_is_taken_when_surrounded_by_black' => [
['.#.', '#o#', '.#.'], 1, 1, true,
],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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];
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants