Skip to content

GrokConfig bad constructor parameter #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theotillotson opened this issue Mar 1, 2025 · 1 comment
Open

GrokConfig bad constructor parameter #2

theotillotson opened this issue Mar 1, 2025 · 1 comment

Comments

@theotillotson
Copy link

PHP Fatal error: Constant expression contains invalid operations in /grok-php/client/src/Config/GrokConfig.php on line 12

expression is not allowed as parameter default value in

public readonly string $baseUri = DefaultConfig::BASE_URI->value,

Composer\Autoload{closure:/home/cwdev/public_html/wp-content/plugins/query-monitor/vendor/composer/ClassLoader.php:575-577}($file = '/home/xxxxx/vendor/composer/../grok-php/client/src/Config/GrokConfig.php') /home/cwdev/public_html/wp-content/plugins/query-monitor/vendor/composer/ClassLoader.php:427

Suggest Change:
public readonly DefaultConfig|string $baseUri = DefaultConfig::BASE_URI

@thefeqy
Copy link
Contributor

thefeqy commented Mar 7, 2025

No worries, I appreciate you reporting this issue!

Could you provide more details? Specifically:

  • Which PHP version are you using?
  • How can I reproduce the issue?
  • What was the expected behavior, and what actually happened?

I recently added a new issue template to make reports more structured. If you don’t mind, you can close this issue and open a new one using the template—it'll help me understand the problem better and fix it more efficiently.

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

No branches or pull requests

2 participants