Skip to content

fix(php): drop unused/vulnerable dev tooling from client template - #1236

Merged
jablan merged 1 commit into
mainfrom
fix/php-remove-unused-linters
Aug 24, 2026
Merged

fix(php): drop unused/vulnerable dev tooling from client template#1236
jablan merged 1 commit into
mainfrom
fix/php-remove-unused-linters

Conversation

@jablan

@jablan jablan commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • CI job phpunit was failing composer install because squizlabs/php_codesniffer: ~2.6 only resolves to versions 2.6.0–2.9.2, all flagged by Composer's built-in security-advisory audit (PKSA-rdkp-vv9z-mjkg, PKSA-6vdd-n4sx-knhy). See failing run: https://github.com/phrase/strings-openapi/actions/runs/32706151798/job/97367588315
  • Neither squizlabs/php_codesniffer nor friendsofphp/php-cs-fixer is invoked anywhere in the PHP client's CI pipeline (.github/workflows/test-php.yml only runs composer install + phpunit), so both are dead dev-dependency weight.
  • The .php_cs config file that would have driven php-cs-fixer was already orphaned: its filename doesn't match the generator's actual supporting-file name (.php-cs-fixer.dist.php), so it was never copied into the generated client, and it uses PhpCsFixer\Config::create(), a static factory removed in php-cs-fixer 3.x.
  • Removed both dependencies and the orphaned config file/.gitattributes reference from openapi-generator/templates/php/composer.mustache.

Test plan

  • CI phpunit job on this PR passes composer install + phpunit

squizlabs/php_codesniffer ~2.6 only resolves to versions flagged by
Composer's security-advisory audit, breaking `composer install` in CI.
Neither it nor friendsofphp/php-cs-fixer is invoked anywhere in the
PHP client's CI pipeline, and the .php_cs config that would have
driven the fixer was already orphaned (wrong filename to be picked up
by the generator, and using a Config::create() API removed in
php-cs-fixer 3.x). Remove both as dead weight.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

API changelog (oasdiff)

Doc-only edits (descriptions, examples) do not appear here.

No changes detected

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes unused and security-advisory-flagged PHP dev tooling from the PHP client template so composer install succeeds in CI and generated clients don’t carry dead dev-dependency weight.

Changes:

  • Drop squizlabs/php_codesniffer and friendsofphp/php-cs-fixer from the PHP template’s require-dev.
  • Remove the orphaned .php_cs config file from the PHP template.
  • Remove the .php_cs export-ignore entry from the PHP template .gitattributes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
openapi-generator/templates/php/composer.mustache Removes unused/vulnerable dev dependencies from generated PHP client composer config.
openapi-generator/templates/php/.php_cs Deletes an orphaned php-cs-fixer config that wasn’t being used/copied.
openapi-generator/templates/php/.gitattributes Removes export-ignore entry for the deleted .php_cs file.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread openapi-generator/templates/php/composer.mustache
@jablan
jablan merged commit e9692e9 into main Aug 24, 2026
14 checks passed
@jablan
jablan deleted the fix/php-remove-unused-linters branch August 24, 2026 09:36
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.

3 participants