spatie / wordpress-ray

Debug with Ray to fix problems faster in WordPress apps
https://myray.app
MIT License
73 stars 14 forks source link

platform_check.php triggers error on php 7.3. Requirement in composer.json says 7.3 #35

Closed jmslbam closed 3 years ago

jmslbam commented 3 years ago

After running composer install in the plugin folder, the error goes away, but the file platform_check.php didn't change.

I read that that is an composer v2 feature. So I downloaded composer v2 and ran the release instructions https://github.com/spatie/wordpress-ray#release-instructions-for-maintainers which again did not change platform_check.php (which I think would / should change, right?)

https://github.com/spatie/wordpress-ray/blob/master/vendor/composer/platform_check.php https://github.com/spatie/wordpress-ray/blob/master/composer.json#L21

For now just reporting this, because I have an release of a project to do, but will come back at this at this next week if it's not fixed by then.

Kind regards,

Jaime

templeman commented 3 years ago

I am running into this issue as well. After installing Ray as a must-use WordPress plugin via Composer (v2), I get the PHP error

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0". You are running 7.3.20-1+ubuntu18.04.1+deb.sury.org+1. in /file/path/here/platform_check.php on line 24

However, the requirements say PHP 7.3+ should work.

I tried reinstalling Ray as a regular plugin with the same result. I also tried manually altering line 7 in platform_check.php from if (!(PHP_VERSION_ID >= 70400)) to if (!(PHP_VERSION_ID >= 70300)) just to see what would happen. The Composer error went away, but then running a simple Ray call ray('test'); resulted in a new error: Parse error: syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /file/path/here/mu-plugins/spatie-ray/vendor/spatie/backtrace/src/Backtrace.php on line 10.

Are the published requirements incorrect, or is something else not right here?

freekmurze commented 3 years ago

Thanks for reporting!

This problem should be solved in v1.2.4 which was just released.

jmslbam commented 3 years ago

Thank you for the swift fix!