fix(php): emit standalone LICENSE file for custom licenses#17102
fix(php): emit standalone LICENSE file for custom licenses#17102adidavid014 wants to merge 2 commits into
Conversation
The PHP generator previously only set the `license` field in composer.json and never wrote a standalone LICENSE file, so GitHub license detection and compliance scanners reported no license. Add a `writeLicenseFile` method to PhpProject that copies the mounted /tmp/LICENSE into the output repo root when a custom license is configured, bringing PHP to parity with the TypeScript, Python, Java, and Go generators. Co-Authored-By: Claude <noreply@anthropic.com>
| scanners reported no license. This brings the PHP generator to parity with the | ||
| TypeScript, Python, Java, and Go generators. | ||
| type: fix | ||
| createdAt: "2026-07-16" |
There was a problem hiding this comment.
🟡 warning
createdAt: "2026-07-16" — unless you've got a time machine, this should probably be 2025.
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 |
Co-Authored-By: Claude <noreply@anthropic.com>
Description
Linear ticket: Closes SE-82
The Fern PHP generator's
PhpProjectnever emitted a standaloneLICENSEfile — it only set thelicensefield incomposer.json. GitHub's license detection and most compliance scanners key off the standaloneLICENSEfile, so any Fern PHP SDK (e.g. Brevo'sgetbrevo/brevo-php, issue #143) showed no detected license.This is a parity gap: the Go, TypeScript, Python, and Java generators each copy the license file mounted at
/tmp/LICENSEinto the output repo root. PHP never got that method — it was an unimplemented feature, not a deliberate decision.Changes Made
writeLicenseFile()method toPhpProject(called at the end ofpersist()), modeled onGoProject.writeLicenseFile— the closest architectural analog (sameAbstractProjectbase andthis.context.config.license/this.absolutePathToOutputDirectory/this.context.loggermembers).customlicense configs, matching Go/TS/Java/C# behavior (SPDXbasiclicenses likeMITstill go intocomposer.json; custom ones get the copied file)./tmp/LICENSE→<output>/<filename>(defaultLICENSE).ENOENT(expected in remote/Fiddle generation) and warns on other errors — preserving backwards compatibility.2.13.3fixchangelog entry togenerators/php/sdk/versions.yml.This makes it a config-only fix for all customers going forward: add
license: { custom: ./LICENSE }to the PHPgithub:block, exactly like the other generators.Testing
/tmp/LICENSE, so even csharp'scustom-licensefixture output contains noLICENSEfile. Adding one would give false coverage.pnpm turbo run compile --filter @fern-api/php-basepasses (13/13 tasks).Generated with Claude Code