Skip to content

Dummy pr#2129

Closed
JonasVHG wants to merge 4 commits intomasterfrom
dummy-pr-for-claude-test
Closed

Dummy pr#2129
JonasVHG wants to merge 4 commits intomasterfrom
dummy-pr-for-claude-test

Conversation

@JonasVHG
Copy link
Contributor

@JonasVHG JonasVHG commented Dec 4, 2025

@Developers, please ignore this PR & do not merge!


@JonasVHG JonasVHG marked this pull request as ready for review December 4, 2025 13:19
@JonasVHG
Copy link
Contributor Author

JonasVHG commented Dec 4, 2025

@claude please review

@claude
Copy link
Contributor

claude bot commented Dec 4, 2025

Claude finished @JonasVHG's task —— View job


Code Review Complete

I've reviewed the PR that adds Dutch street suggestion support. The implementation follows the existing pattern for Belgium streets, but there are several issues that need to be addressed:

Critical Issues 🔴

  1. Configuration typo (app/Address/AddressServiceProvider.php:51): 'doman' should be 'domain' - this will cause a runtime error when the Dutch street suggester is used
  2. Country code inconsistency (src/Http/Address/GetStreetRequestHandler.php:65): Error message shows 'NLD' as valid, but code checks for 'NL' - these should match (recommend using 'NL')

Code Quality Issues 🟡

  1. Parameter typo (src/Http/Address/GetStreetRequestHandler.php:21): $duchtStreetSuggester should be $dutchStreetSuggester
  2. Test property typo (tests/Http/Address/GetStreetRequestHandlerTest.php:23): $steetSuggester2 should be renamed (suggest $dutchStreetSuggester)
  3. Missing service registration (app/Address/AddressServiceProvider.php:47): New Dutch service isn't added to getProvidedServiceNames()

Missing Test Coverage 🟠

  1. No test for NL country code: The new functionality for Dutch addresses isn't tested - should add a test case similar to the existing Belgium test

Architecture Review

Positive:

  • Follows existing pattern consistently
  • Proper dependency injection
  • Good use of caching layer

Concerns:

  • Using the same BPostStreetSuggester for both Belgian and Dutch addresses seems questionable - does BPost actually provide Dutch street data?
  • The Dutch suggester is configured with the same bpost config - is this intentional?

I've added inline comments on each issue. Please address these before merging.


Copy link
Contributor

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Thanks for adding Dutch street suggestion support! I've reviewed the changes and found several issues that need attention before this can be merged. The main concerns are typos that will cause runtime errors and missing test coverage for the new functionality.

fn () => new CachedStreetSuggester(
new BPostStreetSuggester(
new Client(),
$container->get('config')['bpost']['doman'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "doman" should be "domain"

This typo will cause a configuration lookup failure. Line 34 correctly uses 'domain', but this line has 'doman'.

);

$container->addShared(
'Dutch_' . StreetSuggester::class,
Copy link
Contributor

Choose a reason for hiding this comment

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

Service registration not added to getProvidedServiceNames()

The new 'Dutch_' . StreetSuggester::class service is registered but not declared in the getProvidedServiceNames() method (lines 17-23). This could cause issues with service discovery or dependency management depending on how the container is configured.

public function __construct(StreetSuggester $belgiumStreetSuggester)
private StreetSuggester $dutchStreetSuggester;

public function __construct(StreetSuggester $belgiumStreetSuggester, StreetSuggester $duchtStreetSuggester)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "duchtStreetSuggester" should be "dutchStreetSuggester"

Parameter name has a typo ("ducht" instead of "dutch"). While this technically works, it's inconsistent with the property name on line 19 and reduces code readability.

'country',
$countryCode,
['BE']
['BE', 'NLD']
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistency: Error message uses 'NLD' but code checks for 'NL'

Line 52 checks if ($countryCode === 'NL'), but the error message on line 65 lists ['BE', 'NLD'] as valid values. This creates confusion - should the Netherlands country code be 'NL' or 'NLD'?

The check should match the error message. Since ISO 3166-1 alpha-2 country code for Netherlands is 'NL', the error message should be ['BE', 'NL'] instead of ['BE', 'NLD'].


private StreetSuggester&MockObject $streetSuggester;

private StreetSuggester&MockObject $steetSuggester2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "steetSuggester2" should be "streetSuggester2"

Property name has a typo ("steet" instead of "street"). Consider using a more descriptive name like $dutchStreetSuggester to match the actual purpose and the naming in the handler.

$this->streetSuggester = $this->createMock(StreetSuggester::class);
$this->getStreetRequestHandler = new GetStreetRequestHandler($this->streetSuggester);
$this->steetSuggester2 = $this->createMock(StreetSuggester::class);
$this->getStreetRequestHandler = new GetStreetRequestHandler($this->streetSuggester, $this->steetSuggester2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing test coverage for NL country code

The PR adds support for Dutch street suggestions (country code 'NL'), but there's no test case verifying this new functionality works correctly. You should add a test similar to it_can_handle_a_get_street_request() but for NL addresses to ensure the Dutch suggester is called properly.

@JonasVHG
Copy link
Contributor Author

JonasVHG commented Dec 4, 2025

This was just a deliberately bad PR to test how good Claude can replace CoPilot, hence this will be closed & not merged.

@JonasVHG JonasVHG closed this Dec 4, 2025
@JonasVHG JonasVHG deleted the dummy-pr-for-claude-test branch December 4, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant