Skip to content

Use major.minor PHP version in guidelines instead of full version#657

Merged
pushpak1300 merged 1 commit intolaravel:mainfrom
oddvalue:feat/php-major-minor-version
Mar 12, 2026
Merged

Use major.minor PHP version in guidelines instead of full version#657
pushpak1300 merged 1 commit intolaravel:mainfrom
oddvalue:feat/php-major-minor-version

Conversation

@oddvalue
Copy link
Contributor

Description

This PR updates the PHP version output in generated guidelines and the ApplicationInfo MCP tool to use only the major and minor version (e.g. 8.4) instead of the full version including the patch number (e.g. 8.4.3).

Motivation

On teams where different members may be running slightly different patch versions of PHP (e.g. 8.4.1 vs 8.4.3), the full PHP_VERSION constant causes unnecessary churn in guideline files. Every time a team member with a different patch version runs the install command, the guideline file changes, leading to noisy diffs and constant re-generation. Since the patch version is rarely relevant to coding guidelines or API compatibility, using only the major and minor version keeps guideline files stable across the team.

Changes

  • .ai/foundation.blade.php — Changed {{ PHP_VERSION }} to {{ PHP_MAJOR_VERSION }}.{{ PHP_MINOR_VERSION }}
  • src/Mcp/Tools/ApplicationInfo.php — Changed PHP_VERSION to PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION
  • tests/Feature/Mcp/Tools/ApplicationInfoTest.php — Updated test assertions to match the new format

Impact

  • No breaking changes — the version string format changes from 8.x.x to 8.x, which is still valid and more appropriate for guidelines
  • This is consistent with how package versions are already displayed in the foundation template (using $package->majorVersion())
  • All existing tests pass

@pushpak1300 pushpak1300 merged commit 81e0ed4 into laravel:main Mar 12, 2026
23 checks passed
@pushpak1300
Copy link
Member

Thanks.

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