Skip to content
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

Fix TreeBuilder name #8

Merged
merged 1 commit into from
May 31, 2024

Conversation

IndraGunawan
Copy link
Contributor

@IndraGunawan IndraGunawan commented May 24, 2024

I was using PHP config and Symfony generated wrong config class name for this bundle

 There is no extension able to load the configuration for "Symfony\Config\PixelopenCloudflareTurnstileConfig". Looked for namespace "pixelopen_cloudflare_turnstile",
  found "framework", "doctrine", "...", "pixel_open_cloudflare_turnstile".

I've tested this changes and doesn't change the behavior for YAML config

how to reproduce

composer require pixelopen/cloudflare-turnstile-bundle
rm config/packages/pixel_open_cloudflare_turnstile.yaml

Symfony will create a config builder class in var/cache/dev/Symfony/Config/PixelopenCloudflareTurnstileConfig.php

create PHP config

<?PHP

// config/packages/pixel_open_cloudflare_turnstile.php

<?php

use Symfony\Config\PixelopenCloudflareTurnstileConfig;

use function Symfony\Component\DependencyInjection\Loader\Configurator\env;

return static function(PixelopenCloudflareTurnstileConfig $pixelopenCloudflareTurnstile): void {
    $pixelopenCloudflareTurnstile
        ->key(env('TURNSTILE_KEY'))
        ->secret(env('TURNSTILE_SECRET'));
};

this patch will make Symfony create var/cache/dev/Symfony/Config/PixelOpenCloudflareTurnstileConfig.php (with upper-case O) config builder class and point to the correct bundle

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@matthieu2607
Copy link
Collaborator

Hi @IndraGunawan,
Can you give me a more precise example so that I can reproduce it?
Thank you

@IndraGunawan
Copy link
Contributor Author

@matthieu2607 i just updated the PR description to add how to reproduce section

@matthieu2607 matthieu2607 merged commit e387f63 into Pixel-Open:develop May 31, 2024
3 checks passed
@matthieu2607
Copy link
Collaborator

Hi @IndraGunawan, thank you for your pull request.
Best regards

@IndraGunawan IndraGunawan deleted the fix-tree-builder-name branch May 31, 2024 10:16
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

Successfully merging this pull request may close these issues.

2 participants