drupal-project
drupal-project copied to clipboard
Remove php version from composer.json
Including this line in composer.json causes PHPStorm to lock certain settings like setting your PHP language level.
When I removed "php": ">=5.6", and ran composer update --lock, I could then set my language level in PHPStorm, pictured below.

I think this might be a bug related to Composer/PHPStorm, but it is not a simple thing for others to find, particularly when they are configuring aspects of PHPStorm for development.
This seems like as good a place as any to note that, now that the Drupal version is 8.7, that requirement should be >=7.0 (if present at all).
I wouldn't necessarily consider this a bug - you can override this in PHPStorm: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000794610-When-marking-sources-PhpStorm-automatically-returns-to-previous-settings-on-restart?page=1#community_comment_115000659650
The default is very useful in that it prevents you from using language level features that don't fit the Drupal minimum requirements.... assuming you plan on contributing your code back to the community.
It is a bug because it interferes with IDE settings, requiring a user to have to go track that down, as opposed to bumping it (mentioned in that very same link). It would not allow me to do anything at all, and it wasn't clear why or how to rectify that from the IDE.
Even so, at this date:
Drupal 8 will require PHP 7 starting May 1, 2019, on the day of the release of Drupal 8.7.0.
So it sounds like it should be bumped in accordance anyway.
Allready moved up to 7.0.8 with #518
Core 8 composer.json has "php": "^7.0.8" and core 9 composer.json has "php": ">=7.3.0" already. So I guess that should already be enough actually.
We could move the PHP requirement to the platform reqs like drupal/drupal does it. How does that sound?
Ping @webflo @jcnventura