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

feat: drop support of php 7.1, drop support of symfony < 4.4, … #298

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1]
symfony: [2.8, 3.4, 4.4, 5.2, 6.0]
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
symfony: [4.4, 5.4, 6.0]
exclude:
- php: 7.1
symfony: 5.2
- php: 8.0
symfony: 3.4
- php: 7.1
symfony: 6.0
- php: 7.2
symfony: 6.0
- php: 7.3
Expand All @@ -31,7 +25,7 @@ jobs:
symfony: 6.0
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -41,10 +35,10 @@ jobs:

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.2 || ^8.0",
"google/recaptcha": "^1.1",
"symfony/form": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/security-bundle": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/validator": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/yaml": "^2.8 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/form": "^4.4 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/security-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/validator": "^4.4 || ^5.0 || ^6.0",
"symfony/yaml": "^4.4 || ^5.0 || ^6.0",
"twig/twig": "^1.40 || ^2.9 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^7 || ^8 || ^9.5"
"phpunit/phpunit": "^8.5 || ^9.5"
},
"autoload": {
"psr-4": {
Expand Down
20 changes: 10 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./tests/bootstrap.php"
colors="true">
colors="true"
>

<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>

<testsuites>
<testsuite name="EWZRecaptchaBundle">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>

</phpunit>
11 changes: 3 additions & 8 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('ewz_recaptcha');

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder->root('ewz_recaptcha');
}
$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
Expand Down Expand Up @@ -51,7 +46,7 @@ public function getConfigTreeBuilder(): TreeBuilder
return $treeBuilder;
}

private function addHttpClientConfiguration(ArrayNodeDefinition $node)
private function addHttpClientConfiguration(ArrayNodeDefinition $node): void
{
$node
->children()
Expand All @@ -67,7 +62,7 @@ private function addHttpClientConfiguration(ArrayNodeDefinition $node)
;
}

private function addServiceDefinitionConfiguration(ArrayNodeDefinition $node)
private function addServiceDefinitionConfiguration(ArrayNodeDefinition $node): void
{
$node
->children()
Expand Down
2 changes: 0 additions & 2 deletions src/DependencyInjection/EWZRecaptchaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public function load(array $configs, ContainerBuilder $container): void

/**
* Registers the form widget.
*
* @param ContainerBuilder $container
*/
protected function registerWidget(ContainerBuilder $container, int $version = 2): void
{
Expand Down
5 changes: 5 additions & 0 deletions src/Validator/Constraints/IsTrueValidatorV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class IsTrueValidatorV3 extends ConstraintValidator
/** @var LoggerInterface */
private $logger;

/**
* @var ReCaptcha
*/
private $reCaptcha;

/**
* ContainsRecaptchaValidator constructor.
*
Expand Down