fix(php): fix boolean clientDefault quoting and inline path param type handling#15468
fix(php): fix boolean clientDefault quoting and inline path param type handling#15468Swimburger wants to merge 2 commits intomainfrom
Conversation
…e handling Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
|
Is this still necessary? |
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
Description
Follow-up to #15465. Fixes two edge-case bugs in the PHP SDK generator's
clientDefaultsupport identified by code review.Changes Made
RootClientGenerator.ts: AddedgetClientDefaultPhpLiteral()helper that returns properly formatted PHP literals — single-quoted strings for string values, baretrue/falsefor boolean values. Previously, boolean clientDefault values were incorrectly wrapped in quotes (e.g.,$param ??= 'true'instead of$param ??= true), causing a PHP type mismatch when the parameter is typed as?bool.WrappedEndpointRequestGenerator.ts: Removed thephp.Type.optional()wrapping for inline path parameters withclientDefault. TheDataClassconstructor (line 62-63 ofDataClass.ts) uses?? nullfor optional-typed fields, which discards the clientDefault initializer. Keeping the non-optional type preserves the initializer via?? <initializer>(line 64-66).Changelog: Added
generators/php/sdk/changes/unreleased/fix-client-default-boolean-quoting.ymlUpdated README.md generator (if applicable) — N/A
Testing
pnpm seed test --generator php-sdk --fixture x-fern-default --skip-scripts --localpnpm turbo run compile --filter @fern-api/php-sdkpnpm check:biomeLink to Devin session: https://app.devin.ai/sessions/302ae462e00f48019f81795e34b6937a
Requested by: @Swimburger