https://github.com/uuf6429/jetbrains-php-version-switcher
PHP Version Switcher Plugin for PhpStorm/IDEA
https://github.com/uuf6429/jetbrains-php-version-switcher
Last synced: 2 months ago
JSON representation
PHP Version Switcher Plugin for PhpStorm/IDEA
- Host: GitHub
- URL: https://github.com/uuf6429/jetbrains-php-version-switcher
- Owner: uuf6429
- License: mit
- Created: 2024-08-07T19:06:21.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-01T19:42:38.000Z (8 months ago)
- Last Synced: 2025-03-25T19:11:45.107Z (2 months ago)
- Language: Kotlin
- Homepage:
- Size: 2.07 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Version Switcher Plugin
[](https://plugins.jetbrains.com/plugin/25086-php-version-switcher)
[](https://plugins.jetbrains.com/plugin/25086-php-version-switcher)
[](https://plugins.jetbrains.com/plugin/25086-php-version-switcher/versions)
[](https://plugins.jetbrains.com/plugin/25086-php-version-switcher)
[](https://github.com/uuf6429/jetbrains-php-version-switcher/blob/main/LICENSE)This is an IDE plugin that switches
the [PHP Language Level](https://www.jetbrains.com/help/phpstorm/supported-php-versions.html) automatically whenever an
editor window is focused, based on the version defined in the nearest `composer.json` file (to the focused editor file).That behaviour would be helpful if your project contains PHP code intended to run on different PHP versions
(PhpStorm/IDEA) or if you are opening multiple projects as modules (IDEA).https://github.com/user-attachments/assets/db36e668-5f40-4e8d-b69c-62a518c7223a
## _Caveat ingeniator_
### Directory-based Behaviour _(at the moment)_
You cannot have multiple PHP files with different language level in the same directory, since there can only be
one `composer.json` per directory.### The `composer.json` Requirement
The PHP version is only switched when a `composer.json` file exists, containing a `"php"` entry in the `"require"`
section. The `"require-dev"` section is currently ignored.### Conflicting Split Views
The language level is still a global setting. If you have a PHP-7.4 file open next to a PHP-5.6 file, and you focus the
PHP-5.6 one, errors/warnings will probably show up in the PHP-7.4 file since it tries to apply the PHP version there.