Skip to content

Commit

Permalink
Remove compiler pass in favour of the nyholm_psr7 recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Sep 17, 2021
1 parent c2d29f9 commit 3486274
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 65 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ Add or modify the `meteo-concept/hcaptcha-bundle` configuration :
```yaml
# config/packages/meteo_concept_hcaptcha.yaml

parameters:
hcaptcha_site_key: '%env(resolve:HCAPTCHA_SITE_KEY)%'
hcaptcha_secret: '%env(resolve:HCAPTCHA_SECRET)%'

meteo_concept_h_captcha:
hcaptcha:
site_key: '%hcaptcha_site_key%'
secret: '%hcaptcha_secret%'
site_key: '%env(resolve:HCAPTCHA_SITE_KEY)%'
secret: '%env(resolve:HCAPTCHA_SECRET)%'
validation: 'strict'

```
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions src/FluxSESyliusHCaptchaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,10 @@

namespace FluxSE\SyliusHCaptchaPlugin;

use FluxSE\SyliusHCaptchaPlugin\DependencyInjection\CompilerPass\SymfonyHttpClientCompilerPass;
use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class FluxSESyliusHCaptchaPlugin extends Bundle
{
use SyliusPluginTrait;

public function build(ContainerBuilder $container): void
{
parent::build($container);

$container
->addCompilerPass(new SymfonyHttpClientCompilerPass())
;
}
}
9 changes: 2 additions & 7 deletions tests/Application/config/packages/meteo_concept_hcaptcha.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
parameters:
hcaptcha_site_key: '%env(resolve:HCAPTCHA_SITE_KEY)%'
hcaptcha_secret: '%env(resolve:HCAPTCHA_SECRET)%'

meteo_concept_h_captcha:
hcaptcha:
site_key: '%hcaptcha_site_key%'
secret: '%hcaptcha_secret%'
validation: 'strict'
site_key: '%env(resolve:HCAPTCHA_SITE_KEY)%'
secret: '%env(resolve:HCAPTCHA_SECRET)%'
21 changes: 21 additions & 0 deletions tests/Application/config/packages/nyholm_psr7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
# Register nyholm/psr7 services for autowiring with PSR-17 (HTTP factories)
Psr\Http\Message\RequestFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\ResponseFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\ServerRequestFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\StreamFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory'

# Register nyholm/psr7 services for autowiring with HTTPlug factories
Http\Message\MessageFactory: '@nyholm.psr7.httplug_factory'
Http\Message\RequestFactory: '@nyholm.psr7.httplug_factory'
Http\Message\ResponseFactory: '@nyholm.psr7.httplug_factory'
Http\Message\StreamFactory: '@nyholm.psr7.httplug_factory'
Http\Message\UriFactory: '@nyholm.psr7.httplug_factory'

nyholm.psr7.psr17_factory:
class: Nyholm\Psr7\Factory\Psr17Factory

nyholm.psr7.httplug_factory:
class: Nyholm\Psr7\Factory\HttplugFactory

0 comments on commit 3486274

Please sign in to comment.