Constant expression contains invalid operations
SI-IC opened this issue · 8 comments
- Lang Publisher Version: 14.3.1
- Laravel Version: 9.27.0
- PHP Version: 8.1.4
Description:
I've install Lang publisher, set the lang and all work great. But thrice a minute in the laravel.log appear the messages:
local.ERROR: Constant expression contains invalid operations {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Constant expression contains invalid operations at .../vendor/laravel-lang/publisher/src/Helpers/Config.php:30)
[stacktrace]
#0 {main}
"}
Steps To Reproduce:
Just install the publisher and set the lang.
laravel new test
cd test
composer require laravel-lang/publisher
php artisan lang:add it
No errors, no log file.
Can you show the full stack trace of the error and describe your steps in detail? I was unable to reproduce the issue.
Checked on PHP 8.1.4 and 8.1.10.
Hello,
Please try to install telescope. I have removed telescope and errors are gone, and when I install telescope again they appeared again.
The fact is that this is the entire stack trace that I presented. There is nothing else in laravel.log but many messages
local.ERROR: Constant expression contains invalid operations {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Constant expression contains invalid operations at .../vendor/laravel-lang/publisher/src/Helpers/Config.php:30)
[stacktrace]
#0 {main}
"}
It seems that the error is related to the comment https://www.php.net/manual/en/language.oop5.decon.php#127493
composer require --dev laravel-lang/publisher laravel-lang/lang laravel-lang/attributes laravel/telescope
php artisan lang:add it
No errors ¯_(ツ)_/¯
PHP: 8.1.10
Laravel 9.27.0
Lang Publisher: 14.3.1, 14.3.2
Lang: 11.0.19
Lang Attributes: 2.0.6
Try to run composer update
and check again.
We have released publisher version 14.3.2
.
Great! It helped! Thank you.
Excellent! The problem was not in the class arguments, but in the typing of the method:
Okay, I get it. Thanks again.