From 0d4760e13922ad63652bb35fda009cd1a7c934e1 Mon Sep 17 00:00:00 2001 From: jmsche Date: Mon, 2 Mar 2026 14:50:05 +0100 Subject: [PATCH] Require PHP 8.4 & Symfony 7.4+/8.0; upgrade requirements --- .github/workflows/build-docs.yaml | 2 +- .github/workflows/coding-standards.yaml | 6 +- .github/workflows/continuous-integration.yaml | 15 ++- .github/workflows/static-analysis.yaml | 6 +- CHANGELOG-6.x.md | 11 +++ README.md | 25 ++--- UPGRADE-6.x.md | 10 ++ composer.json | 50 +++++----- docs/form_types.md | 4 +- docs/index.md | 8 +- docs/utilities.md | 19 ---- docs/validators.md | 24 ----- mkdocs.yml | 2 +- phpstan-baseline.neon | 12 --- src/EasyAdmin/Field/FileField.php | 5 +- src/EasyAdmin/Field/ImageField.php | 5 +- src/Feed/FeedItem.php | 2 +- src/Twig/Extension/QrCodeExtension.php | 56 +++-------- src/Util/PasswordStrengthChecker.php | 94 ------------------ .../Constraints/PasswordStrength.php | 40 -------- .../Constraints/PasswordStrengthValidator.php | 43 -------- src/Validator/Constraints/Slug.php | 15 +-- tests/Datalist/DatalistFactoryTest.php | 4 +- .../Filter/Type/BooleanFilterTypeTest.php | 8 +- .../Filter/Type/ChoiceFilterTypeTest.php | 8 +- .../Filter/Type/EnumFilterTypeTest.php | 8 +- .../Filter/Type/IsNullFilterTypeTest.php | 8 +- .../Filter/Type/SearchFilterTypeTest.php | 8 +- tests/Form/Type/RecaptchaTypeTest.php | 4 +- tests/Form/Type/RecaptchaV3TypeTest.php | 2 +- tests/Listener/FileSubscriberTest.php | 8 +- tests/Paginator/DoctrineORMPaginatorTest.php | 6 +- .../Twig/Extension/DatalistExtensionTest.php | 10 +- tests/Twig/Extension/TextExtensionTest.php | 2 +- tests/Util/PasswordStrengthCheckerTest.php | 34 ------- .../PasswordStrengthValidatorTest.php | 98 ------------------- translations/validators.en.yml | 3 - translations/validators.fr.yml | 3 - 38 files changed, 138 insertions(+), 530 deletions(-) create mode 100644 CHANGELOG-6.x.md create mode 100644 UPGRADE-6.x.md delete mode 100644 src/Util/PasswordStrengthChecker.php delete mode 100644 src/Validator/Constraints/PasswordStrength.php delete mode 100644 src/Validator/Constraints/PasswordStrengthValidator.php delete mode 100644 tests/Util/PasswordStrengthCheckerTest.php delete mode 100644 tests/Validator/PasswordStrengthValidatorTest.php diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml index fc213d3f..d0ab5113 100644 --- a/.github/workflows/build-docs.yaml +++ b/.github/workflows/build-docs.yaml @@ -2,7 +2,7 @@ name: Build docs on: push: - branches: ['5.x'] + branches: ['6.x'] jobs: deploy: diff --git a/.github/workflows/coding-standards.yaml b/.github/workflows/coding-standards.yaml index 6e5487b6..93855782 100644 --- a/.github/workflows/coding-standards.yaml +++ b/.github/workflows/coding-standards.yaml @@ -2,9 +2,9 @@ name: Coding Standards on: pull_request: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] push: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] jobs: easy-coding-standard: @@ -14,7 +14,7 @@ jobs: strategy: matrix: php-version: - - '8.4' + - '8.5' steps: - name: Checkout code diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index b377a34c..64827052 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -2,9 +2,9 @@ name: Continuous Integration on: pull_request: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] push: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] jobs: phpunit: @@ -17,18 +17,15 @@ jobs: strategy: matrix: php-version: - - '8.2' - - '8.3' - '8.4' - '8.5' symfony-version: - - '6.4.*' - '7.4.*' + - '8.0.*' include: - - php-version: '8.4' - symfony-version: '8.0.*' - php-version: '8.5' - symfony-version: '8.0.*' + symfony-version: '8.1.*@dev' + continue-on-error: true steps: - name: Checkout code @@ -56,4 +53,4 @@ jobs: - name: Upload to Codecov uses: codecov/codecov-action@v5 - if: matrix.php-version == '8.2' && matrix.symfony-version == '6.4.*' + if: matrix.php-version == '8.4' && matrix.symfony-version == '7.4.*' diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index 442fabe0..565920b3 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -2,9 +2,9 @@ name: Static Analysis on: pull_request: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] push: - branches: ['5.x', '4.x', '3.x'] + branches: ["*.x"] jobs: phpstan: @@ -14,7 +14,7 @@ jobs: strategy: matrix: php-version: - - '8.4' + - '8.5' steps: - name: Checkout code diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md new file mode 100644 index 00000000..e1f1b4c5 --- /dev/null +++ b/CHANGELOG-6.x.md @@ -0,0 +1,11 @@ +6.0.0 +----- + +* Dropped support for PHP < 8.4 +* Dropped support for Symfony 6.4 & Symfony < 7.4 +* Upgraded dev dependencies +* Removed the PasswordStrength constraint, use the one from Symfony instead +* Removed PasswordStrengthChecker +* Dropped support for doctrine/orm v2 +* Required Twig >= 3.23 +* Removed support for endroid/qr-code < 6 diff --git a/README.md b/README.md index ee26c51f..c7b86f23 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ Leapt Core Bundle ================= [![Package version](https://img.shields.io/packagist/v/leapt/core-bundle.svg?style=flat-square)](https://packagist.org/packages/leapt/core-bundle) -[![Build Status](https://img.shields.io/github/actions/workflow/status/leapt/core-bundle/continuous-integration.yaml?branch=5.x&style=flat-square)](https://github.com/leapt/core-bundle/actions?query=workflow%3A%22Continuous+Integration%22) -[![PHP Version](https://img.shields.io/packagist/php-v/leapt/core-bundle.svg?branch=5.x&style=flat-square)](https://travis-ci.org/leapt/core-bundle?branch=5.x) +[![Build Status](https://img.shields.io/github/actions/workflow/status/leapt/core-bundle/continuous-integration.yaml?branch=6.x&style=flat-square)](https://github.com/leapt/core-bundle/actions?query=workflow%3A%22Continuous+Integration%22) +[![PHP Version](https://img.shields.io/packagist/php-v/leapt/core-bundle.svg?branch=6.x&style=flat-square)](https://travis-ci.org/leapt/core-bundle?branch=6.x) [![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE) -[![Code coverage](https://img.shields.io/codecov/c/github/leapt/core-bundle?style=flat-square)](https://codecov.io/gh/leapt/core-bundle/branch/5.x) +[![Code coverage](https://img.shields.io/codecov/c/github/leapt/core-bundle?style=flat-square)](https://codecov.io/gh/leapt/core-bundle/branch/6.x) Introduction ------------ @@ -48,19 +48,20 @@ You can check docs there: https://core-bundle.leapt.dev/ Versions & dependencies ----------------------- -The current version (5.x) of the bundle works with Symfony 6.4, 7.0+ & 8.0+. +The current version (6.x) of the bundle works with Symfony 7.4 & 8.0+. The project follows SemVer. Only the last major version is maintained. -You can check the [changelog](CHANGELOG-5.x.md) for version 5 and the [upgrade document](UPGRADE-5.x.md) when upgrading -from 4.x bundle version. +You can check the [changelog](CHANGELOG-6.x.md) for version 6 and the [upgrade document](UPGRADE-6.x.md) when upgrading +from 5.x bundle version. -| CoreBundle version | Symfony version | PHP version | -|--------------------|-----------------|----------------| -| 5.x | ^6.4 \|\| ^7.0 | ^8.2 | -| 4.x | ^5.4 \|\| ^6.0 | ^8.0 | -| 3.1+ | ^4.4 \|\| ^5.0 | ^7.4 \|\| ^8.0 | -| 3.0 | ^4.4 \|\| ^5.0 | ^7.2 | +| CoreBundle version | Symfony version | PHP version | +|--------------------|--------------------------|----------------| +| 6.x | ^7.4 \|\| ^8.0 | ^8.4 | +| 5.x | ^6.4 \|\| ^7.0 \|\| ^8.0 | ^8.2 | +| 4.x | ^5.4 \|\| ^6.0 | ^8.0 | +| 3.1+ | ^4.4 \|\| ^5.0 | ^7.4 \|\| ^8.0 | +| 3.0 | ^4.4 \|\| ^5.0 | ^7.2 | Contributing ------------ diff --git a/UPGRADE-6.x.md b/UPGRADE-6.x.md new file mode 100644 index 00000000..76bc2398 --- /dev/null +++ b/UPGRADE-6.x.md @@ -0,0 +1,10 @@ +Upgrade guide for 6.0 +--------------------- + +* Requires PHP 8.4+ +* Requires Symfony 7.4/8.0+ +* Removed the PasswordStrength constraint, use the one from Symfony instead +* Removed PasswordStrengthChecker +* Dropped support for doctrine/orm v2 +* Requires Twig >= 3.23 +* Removed support for endroid/qr-code < 6 diff --git a/composer.json b/composer.json index 063c33f4..2646d02a 100644 --- a/composer.json +++ b/composer.json @@ -25,34 +25,34 @@ ], "minimum-stability": "stable", "require": { - "php": "^8.2", - "doctrine/orm": "^2.10 || ^3.0", + "php": "^8.4", + "doctrine/orm": "^3.0", "symfony/deprecation-contracts": "^3.5", - "symfony/event-dispatcher": "^6.4 || ^7.0 || ^8.0", - "symfony/form": "^6.4 || ^7.0 || ^8.0", - "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", - "symfony/http-foundation": "^6.4 || ^7.0 || ^8.0", - "symfony/http-kernel": "^6.4 || ^7.0 || ^8.0", - "symfony/mime": "^6.4 || ^7.0 || ^8.0", - "symfony/routing": "^6.4 || ^7.0 || ^8.0", - "symfony/translation": "^6.4 || ^7.0 || ^8.0", - "symfony/twig-bundle": "^6.4 || ^7.0 || ^8.0", - "symfony/validator": "^6.4 || ^7.0 || ^8.0", - "twig/twig": "^3.0" + "symfony/event-dispatcher": "^7.4 || ^8.0", + "symfony/form": "^7.4 || ^8.0", + "symfony/framework-bundle": "^7.4 || ^8.0", + "symfony/http-foundation": "^7.4 || ^8.0", + "symfony/http-kernel": "^7.4 || ^8.0", + "symfony/mime": "^7.4 || ^8.0", + "symfony/routing": "^7.4 || ^8.0", + "symfony/translation": "^7.4 || ^8.0", + "symfony/twig-bundle": "^7.4 || ^8.0", + "symfony/validator": "^7.4 || ^8.0", + "twig/twig": "^3.23" }, "require-dev": { "doctrine/data-fixtures": "^1.6 || ^2.2", - "doctrine/persistence": "^3.2 || ^4.0", - "easycorp/easyadmin-bundle": "^4.8.5", - "endroid/qr-code": "^4.8 || ^5.0 || ^6.0", + "doctrine/persistence": "^4.0", + "easycorp/easyadmin-bundle": "^5.0.0", + "endroid/qr-code": "^6.0", "fakerphp/faker": "^1.23", "google/recaptcha": "^1.3", "league/flysystem-bundle": "^3.0", - "phpstan/phpstan": "^2.1.22", - "phpstan/phpstan-deprecation-rules": "^2.0.3", - "phpunit/phpunit": "^11.5.35", - "symfony/browser-kit": "^6.4 || ^7.0 || ^8.0", - "symplify/easy-coding-standard": "^13.0.0" + "phpstan/phpstan": "^2.1.40", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpunit/phpunit": "^13.0.5", + "symfony/browser-kit": "^7.4 || ^8.0", + "symplify/easy-coding-standard": "^13.0.4" }, "config": { "sort-packages": true @@ -63,10 +63,10 @@ "@phpstan", "@phpunit" ], - "cs:dry": "vendor/bin/ecs", - "cs:fix": "vendor/bin/ecs --fix", - "phpstan": "vendor/bin/phpstan analyse --ansi", - "phpunit": "vendor/bin/phpunit --colors=auto" + "cs:dry": "@php vendor/bin/ecs", + "cs:fix": "@php vendor/bin/ecs --fix", + "phpstan": "@php vendor/bin/phpstan analyse --ansi", + "phpunit": "@php vendor/bin/phpunit --colors=auto" }, "autoload": { "psr-4": { diff --git a/docs/form_types.md b/docs/form_types.md index 93471c1f..24fade7e 100644 --- a/docs/form_types.md +++ b/docs/form_types.md @@ -61,6 +61,7 @@ If you don't know how to apply a form theme to your forms, [please check Symfony !!! info + * Changed in v6.0.0: the FileField requires EasyAdmin bundle v5.0.0+. * Added in v4.5.0: a FileField is available to use with EasyAdmin bundle. Requires EasyAdmin bundle v4.3.3+. * Added in v4.11.0: `file_type_class` and `file_attr` options. @@ -73,7 +74,8 @@ See also [File uploads](file_uploads.md). !!! info - Added in v4.5.0: an ImageField is available to use with EasyAdmin bundle. Requires EasyAdmin bundle v4.3.3+. + * Changed in v6.0.0: the ImageField requires EasyAdmin bundle v5.0.0+. + * Added in v4.5.0: an ImageField is available to use with EasyAdmin bundle. Requires EasyAdmin bundle v4.3.3+. ## Recaptcha type diff --git a/docs/index.md b/docs/index.md index 66e5d6a8..268cfafa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,10 +12,10 @@ The Leapt Core bundle is a bundle used to help with some repetitive tasks, inclu - [SEO-related tasks (sitemaps, etc)](sitemaps.md) - [Twig extensions](twig_extensions.md) - [Utilities](utilities.md) -- [Validators: PasswordStrength, Recaptcha, Slug](validators.md) +- [Validators: Recaptcha, Slug](validators.md) If you find a bug or want to add a functionality, -[please create an issue or a pull request on Github](https://github.com/leapt/core-bundle)! +[please create an issue or a pull request on GitHub](https://github.com/leapt/core-bundle)! ## Examples @@ -29,9 +29,9 @@ If you find a bug or want to add a functionality, ## Installation -This bundle requires PHP 8.2+. +This bundle requires PHP 8.4+. -As the bundle is compatible with Symfony 6.4/7.0+/8.0+ and Symfony Flex, the only thing you have to do +As the bundle is compatible with Symfony 7.4/8.0+ and Symfony Flex, the only thing you have to do is requiring the package with composer: ```bash diff --git a/docs/utilities.md b/docs/utilities.md index 65143a4b..084b13a0 100644 --- a/docs/utilities.md +++ b/docs/utilities.md @@ -1,24 +1,5 @@ # Utilities -## PasswordStrengthChecker - -This class has only one method: `getStrength`, and returns the strength of a given password (between 0 and 100, -100 being the best value). - -If the second argument - `$username` - is provided, the method will remove the username from the password -if it contains it. - -See also the [PasswordStrength constraint](validators.md#passwordstrength). - -!!! example "Usage" - - ```php - use Leapt\CoreBundle\Util\PasswordStrengthChecker; - - $passwordStrengthChecker = new PasswordStrengthChecker(); - $score = $passwordStrengthChecker->getStrength($password, $username); - ``` - ## StringUtil The StringUtil has 4 public & static methods, their names speak for themselves: diff --git a/docs/validators.md b/docs/validators.md index e6bbea89..97108dc8 100644 --- a/docs/validators.md +++ b/docs/validators.md @@ -1,29 +1,5 @@ # Validator Constraints -## PasswordStrength - -The PasswordStrengthChecker is based on a snipped provided in Symfony 1. - -!!! example "Usage" - - ```php - use Leapt\CoreBundle\Validator\Constraints as LeaptAssert; - - #[LeaptAssert\PasswordStrength(min: 6, max: 72, score: 80')] - public string $plainPassword; - ``` - -??? info "Options" - - | Name | Description | Default value | - | ---- | ----------- | ------------- | - | min | Minimum length for the password. | null | - | max | Maximum length for the password. | null | - | score | Required strength to pass validation, between 0 and 100. | 50 | - | minMessage | Message shown if the password is too short. | This password is too short. It should have {{ limit }} characters or more. | - | maxMessage | Message shown if the password is too long. | This password is too long. It should have {{ limit }} characters or less. | - | scoreMessage | Message shown if the password is not strong enough. | This password is not strong enough. | - ## Recaptcha This validator should be used with the [Recaptcha Type](form_types.md#recaptcha-type), and is based on the diff --git a/mkdocs.yml b/mkdocs.yml index 4be14bbc..fa60d47c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,7 +3,7 @@ site_description: Documentation for leapt/core-bundle repo_name: leapt/core-bundle repo_url: https://github.com/leapt/core-bundle -edit_uri: https://github.com/leapt/core-bundle/edit/4.x/docs/ +edit_uri: https://github.com/leapt/core-bundle/edit/6.x/docs/ theme: name: material diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 700656d9..100e6552 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -84,12 +84,6 @@ parameters: count: 1 path: src/Twig/Extension/PaginatorExtension.php - - - rawMessage: 'Call to function method_exists() with ''Endroid\\QrCode\\Builder\\Builder'' and ''create'' will always evaluate to false.' - identifier: function.impossibleType - count: 1 - path: src/Twig/Extension/QrCodeExtension.php - - rawMessage: ''' Call to deprecated method getExpressionParser() of class Twig\Parser: @@ -138,12 +132,6 @@ parameters: count: 3 path: src/Twig/TokenParser/PaginatorThemeTokenParser.php - - - rawMessage: 'Method Symfony\Component\Validator\Constraints\Regex::__construct() invoked with 8 parameters, 1-7 required.' - identifier: arguments.count - count: 1 - path: src/Validator/Constraints/Slug.php - - rawMessage: 'Method Leapt\CoreBundle\Tests\LeaptCoreTestingKernel::configureContainer() is unused.' identifier: method.unused diff --git a/src/EasyAdmin/Field/FileField.php b/src/EasyAdmin/Field/FileField.php index 08529c4f..9be5fccc 100644 --- a/src/EasyAdmin/Field/FileField.php +++ b/src/EasyAdmin/Field/FileField.php @@ -7,6 +7,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface; use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait; use Leapt\CoreBundle\Form\Type\FileType; +use Symfony\Contracts\Translation\TranslatableInterface; final class FileField implements FieldInterface { @@ -16,9 +17,9 @@ final class FileField implements FieldInterface public const OPTION_ALLOW_DOWNLOAD = 'allowDownload'; public const OPTION_FILE_PATH = 'filePath'; - public static function new(string $propertyName, ?string $label = null): self + public static function new(string $propertyName, TranslatableInterface|string|bool|null $label = null): self { - return (new self()) + return new self() ->setProperty($propertyName) ->setLabel($label) ->setTemplateName('crud/field/text') diff --git a/src/EasyAdmin/Field/ImageField.php b/src/EasyAdmin/Field/ImageField.php index b44d213b..d7fa3948 100644 --- a/src/EasyAdmin/Field/ImageField.php +++ b/src/EasyAdmin/Field/ImageField.php @@ -7,6 +7,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface; use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait; use Leapt\CoreBundle\Form\Type\ImageType; +use Symfony\Contracts\Translation\TranslatableInterface; final class ImageField implements FieldInterface { @@ -16,9 +17,9 @@ final class ImageField implements FieldInterface public const OPTION_ALLOW_DOWNLOAD = 'allowDownload'; public const OPTION_FILE_PATH = 'filePath'; - public static function new(string $propertyName, ?string $label = null): self + public static function new(string $propertyName, TranslatableInterface|string|bool|null $label = null): self { - return (new self()) + return new self() ->setProperty($propertyName) ->setLabel($label) ->setTemplatePath('@LeaptCore/EasyAdmin/field/image.html.twig') diff --git a/src/Feed/FeedItem.php b/src/Feed/FeedItem.php index cebf2633..5a2d87ef 100644 --- a/src/Feed/FeedItem.php +++ b/src/Feed/FeedItem.php @@ -50,7 +50,7 @@ class FeedItem * * This value must be set if the description is not set */ - #[Assert\Url] + #[Assert\Url(requireTld: false)] public string $link; /** diff --git a/src/Twig/Extension/QrCodeExtension.php b/src/Twig/Extension/QrCodeExtension.php index 7be1f2f5..c737b628 100644 --- a/src/Twig/Extension/QrCodeExtension.php +++ b/src/Twig/Extension/QrCodeExtension.php @@ -7,9 +7,7 @@ use Endroid\QrCode\Builder\Builder; use Endroid\QrCode\Encoding\Encoding; use Endroid\QrCode\ErrorCorrectionLevel; -use Endroid\QrCode\ErrorCorrectionLevel\ErrorCorrectionLevelHigh; use Endroid\QrCode\RoundBlockSizeMode; -use Endroid\QrCode\RoundBlockSizeMode\RoundBlockSizeModeMargin; use Endroid\QrCode\Writer\PngWriter; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; @@ -29,45 +27,21 @@ public function getQrCodeFromString(string $qrCodeContent, int $size = 200, int throw new \Exception('The "endroid/qr-code" package is required to use the "get_qr_code_from_string" Twig function. Try running "composer require endroid/qr-code".'); } - if (class_exists(ErrorCorrectionLevel::class)) { - // endroid/qr-code v5 handles enums - $errorCorrectionLevel = ErrorCorrectionLevel::High; - $roundBlockSizeMode = RoundBlockSizeMode::Margin; - } else { - // while v4 handles classes - \assert(class_exists(ErrorCorrectionLevelHigh::class)); - $errorCorrectionLevel = new ErrorCorrectionLevelHigh(); - \assert(class_exists(RoundBlockSizeModeMargin::class)); - $roundBlockSizeMode = new RoundBlockSizeModeMargin(); - } - - if (method_exists(Builder::class, 'create')) { - // v4 & v5 - $result = Builder::create() - ->writer(new PngWriter()) - ->writerOptions([]) - ->data($qrCodeContent) - ->encoding(new Encoding('UTF-8')) - ->errorCorrectionLevel($errorCorrectionLevel) - ->size($size) - ->margin($margin) - ->roundBlockSizeMode($roundBlockSizeMode) - ->build(); - } else { - // v6 - $builder = new Builder( - writer: new PngWriter(), - writerOptions: [], - data: $qrCodeContent, - encoding: new Encoding('UTF-8'), - errorCorrectionLevel: $errorCorrectionLevel, - size: $size, - margin: $margin, - roundBlockSizeMode: $roundBlockSizeMode, - ); - - $result = $builder->build(); - } + $errorCorrectionLevel = ErrorCorrectionLevel::High; + $roundBlockSizeMode = RoundBlockSizeMode::Margin; + + $builder = new Builder( + writer: new PngWriter(), + writerOptions: [], + data: $qrCodeContent, + encoding: new Encoding('UTF-8'), + errorCorrectionLevel: $errorCorrectionLevel, + size: $size, + margin: $margin, + roundBlockSizeMode: $roundBlockSizeMode, + ); + + $result = $builder->build(); return $result->getDataUri(); } diff --git a/src/Util/PasswordStrengthChecker.php b/src/Util/PasswordStrengthChecker.php deleted file mode 100644 index da8306a4..00000000 --- a/src/Util/PasswordStrengthChecker.php +++ /dev/null @@ -1,94 +0,0 @@ -= $i; ++$i) { - $temp = str_split($password, $i); - - $strength -= (ceil($password_length / $i) - \count(array_unique($temp))); - } - - preg_match_all('/[0-9]/', $password, $numbers); - - $numbers = \count($numbers[0]); - if (3 <= $numbers) { - $strength += 5; - } - - preg_match_all('/[|!@#$%&*\/=?,;.:\-_+~^¨\\\]/', $password, $symbols); - - $symbols = \count($symbols[0]); - if (2 <= $symbols) { - $strength += 5; - } - - preg_match_all('/[a-z]/', $password, $lowercase_characters); - preg_match_all('/[A-Z]/', $password, $uppercase_characters); - - $lowercase_characters = \count($lowercase_characters[0]); - $uppercase_characters = \count($uppercase_characters[0]); - - if ((0 < $lowercase_characters) && (0 < $uppercase_characters)) { - $strength += 10; - } - - $characters = $lowercase_characters + $uppercase_characters; - - if ((0 < $numbers) && (0 < $symbols)) { - $strength += 15; - } - - if ((0 < $numbers) && (0 < $characters)) { - $strength += 15; - } - - if ((0 < $symbols) && (0 < $characters)) { - $strength += 15; - } - - if ((0 === $numbers) && (0 === $symbols)) { - $strength -= 10; - } - - if ((0 === $symbols) && (0 === $characters)) { - $strength -= 10; - } - - if (0 > $strength) { - $strength = 0; - } - - if (100 < $strength) { - $strength = 100; - } - - return $strength; - } -} diff --git a/src/Validator/Constraints/PasswordStrength.php b/src/Validator/Constraints/PasswordStrength.php deleted file mode 100644 index 67328b19..00000000 --- a/src/Validator/Constraints/PasswordStrength.php +++ /dev/null @@ -1,40 +0,0 @@ -min = $min ?? $this->min; - $this->minMessage = $minMessage ?? $this->minMessage; - $this->max = $max ?? $this->max; - $this->maxMessage = $maxMessage ?? $this->maxMessage; - $this->score = $score ?? $this->score; - $this->scoreMessage = $scoreMessage ?? $this->scoreMessage; - } -} diff --git a/src/Validator/Constraints/PasswordStrengthValidator.php b/src/Validator/Constraints/PasswordStrengthValidator.php deleted file mode 100644 index db9da35b..00000000 --- a/src/Validator/Constraints/PasswordStrengthValidator.php +++ /dev/null @@ -1,43 +0,0 @@ -min && \strlen($value) < $constraint->min) { - $this->context->addViolation($constraint->minMessage, ['{{ limit }}' => $constraint->min]); - - return; - } - if (null !== $constraint->max && \strlen($value) > $constraint->max) { - $this->context->addViolation($constraint->maxMessage, ['{{ limit }}' => $constraint->max]); - - return; - } - - $checker = new PasswordStrengthChecker(); - $score = $checker->getStrength($value); - - if ($score < $constraint->score) { - $this->context->addViolation($constraint->scoreMessage); - } - } -} diff --git a/src/Validator/Constraints/Slug.php b/src/Validator/Constraints/Slug.php index f188fb80..ffaca44c 100644 --- a/src/Validator/Constraints/Slug.php +++ b/src/Validator/Constraints/Slug.php @@ -11,26 +11,15 @@ class Slug extends Regex { public function __construct( - string|array|null $pattern = '/^([a-z0-9]+)(?:-[a-z0-9]+)*$/', + ?string $pattern = '/^([a-z0-9]+)(?:-[a-z0-9]+)*$/', string $message = 'A slug can only contain lowercase letters, numbers and hyphens.', ?string $htmlPattern = null, ?bool $match = null, ?callable $normalizer = null, ?array $groups = null, mixed $payload = null, - ?array $options = null, ) { - if (null !== $options) { - trigger_deprecation('leapt/core-bundle', '5.6.1', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class); - parent::__construct($pattern, $message, $htmlPattern, $match, $normalizer, $groups, $payload, $options); - } else { - parent::__construct($pattern, $message, $htmlPattern, $match, $normalizer, $groups, $payload); - } - } - - public function getRequiredOptions(): array - { - return []; + parent::__construct($pattern, $message, $htmlPattern, $match, $normalizer, $groups, $payload); } public function validatedBy(): string diff --git a/tests/Datalist/DatalistFactoryTest.php b/tests/Datalist/DatalistFactoryTest.php index 23545ad2..3ddd00a4 100644 --- a/tests/Datalist/DatalistFactoryTest.php +++ b/tests/Datalist/DatalistFactoryTest.php @@ -18,8 +18,8 @@ final class DatalistFactoryTest extends TestCase { public function testInitialize(): void { - $formFactory = $this->createMock(FormFactoryInterface::class); - $router = $this->createMock(RouterInterface::class); + $formFactory = $this->createStub(FormFactoryInterface::class); + $router = $this->createStub(RouterInterface::class); $datalistFactory = new DatalistFactory($formFactory, $router); self::assertInstanceOf(BooleanFilterType::class, $datalistFactory->getFilterType(BooleanFilterType::class)); diff --git a/tests/Datalist/Filter/Type/BooleanFilterTypeTest.php b/tests/Datalist/Filter/Type/BooleanFilterTypeTest.php index 66d38ff3..7d5ab126 100644 --- a/tests/Datalist/Filter/Type/BooleanFilterTypeTest.php +++ b/tests/Datalist/Filter/Type/BooleanFilterTypeTest.php @@ -25,11 +25,11 @@ public function testFilter(string $property, bool|string $value, array $expected $booleanFilterType = new BooleanFilterType(); $request = new Request([$property => $value]); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); - $datalistFactory = new DatalistFactory($formFactory, $this->createMock(RouterInterface::class)); + $datalistFactory = new DatalistFactory($formFactory, $this->createStub(RouterInterface::class)); $datalistFactory->registerFilterType($booleanFilterType); $datalist = $datalistFactory->createBuilder(DatalistType::class) ->addFilter($property, BooleanFilterType::class) diff --git a/tests/Datalist/Filter/Type/ChoiceFilterTypeTest.php b/tests/Datalist/Filter/Type/ChoiceFilterTypeTest.php index 374d23bf..d3c58d4c 100644 --- a/tests/Datalist/Filter/Type/ChoiceFilterTypeTest.php +++ b/tests/Datalist/Filter/Type/ChoiceFilterTypeTest.php @@ -25,11 +25,11 @@ public function testFilter(string|array|null $searchValue, bool $multiple, array $choiceFilterType = new ChoiceFilterType(); $request = new Request(['category' => $searchValue]); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); - $datalistFactory = new DatalistFactory($formFactory, $this->createMock(RouterInterface::class)); + $datalistFactory = new DatalistFactory($formFactory, $this->createStub(RouterInterface::class)); $datalistFactory->registerFilterType($choiceFilterType); $datalist = $datalistFactory->createBuilder(DatalistType::class) ->addFilter('category', ChoiceFilterType::class, [ diff --git a/tests/Datalist/Filter/Type/EnumFilterTypeTest.php b/tests/Datalist/Filter/Type/EnumFilterTypeTest.php index caa0b404..0b3ef5c9 100644 --- a/tests/Datalist/Filter/Type/EnumFilterTypeTest.php +++ b/tests/Datalist/Filter/Type/EnumFilterTypeTest.php @@ -26,11 +26,11 @@ public function testFilter(\BackedEnum|string|array|null $searchValue, bool $mul $enumFilterType = new EnumFilterType(); $request = new Request(['category' => $searchValue]); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); - $datalistFactory = new DatalistFactory($formFactory, $this->createMock(RouterInterface::class)); + $datalistFactory = new DatalistFactory($formFactory, $this->createStub(RouterInterface::class)); $datalistFactory->registerFilterType($enumFilterType); $datalist = $datalistFactory->createBuilder(DatalistType::class) ->addFilter('category', EnumFilterType::class, [ diff --git a/tests/Datalist/Filter/Type/IsNullFilterTypeTest.php b/tests/Datalist/Filter/Type/IsNullFilterTypeTest.php index 14e5e6e7..01f834da 100644 --- a/tests/Datalist/Filter/Type/IsNullFilterTypeTest.php +++ b/tests/Datalist/Filter/Type/IsNullFilterTypeTest.php @@ -25,11 +25,11 @@ public function testFilter(?string $value, array $expectedResult): void $isNullFilterType = new IsNullFilterType(); $request = new Request(['description' => $value]); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); - $datalistFactory = new DatalistFactory($formFactory, $this->createMock(RouterInterface::class)); + $datalistFactory = new DatalistFactory($formFactory, $this->createStub(RouterInterface::class)); $datalistFactory->registerFilterType($isNullFilterType); $datalist = $datalistFactory->createBuilder(DatalistType::class) ->addFilter('description', IsNullFilterType::class) diff --git a/tests/Datalist/Filter/Type/SearchFilterTypeTest.php b/tests/Datalist/Filter/Type/SearchFilterTypeTest.php index df5db8b3..290aea55 100644 --- a/tests/Datalist/Filter/Type/SearchFilterTypeTest.php +++ b/tests/Datalist/Filter/Type/SearchFilterTypeTest.php @@ -25,11 +25,11 @@ public function testFilter(string|array $searchFields, string $searchValue, arra $searchFilterType = new SearchFilterType(); $request = new Request(['data' => $searchValue]); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); - $datalistFactory = new DatalistFactory($formFactory, $this->createMock(RouterInterface::class)); + $datalistFactory = new DatalistFactory($formFactory, $this->createStub(RouterInterface::class)); $datalistFactory->registerFilterType($searchFilterType); $datalist = $datalistFactory->createBuilder(DatalistType::class) ->addFilter('data', SearchFilterType::class, [ diff --git a/tests/Form/Type/RecaptchaTypeTest.php b/tests/Form/Type/RecaptchaTypeTest.php index 39f0245d..363fb279 100644 --- a/tests/Form/Type/RecaptchaTypeTest.php +++ b/tests/Form/Type/RecaptchaTypeTest.php @@ -19,7 +19,7 @@ final class RecaptchaTypeTest extends TestCase protected function setUp(): void { - $requestStack = $this->createMock(RequestStack::class); + $requestStack = $this->createStub(RequestStack::class); $localeResolver = new LocaleResolver('de', false, $requestStack); $this->type = new RecaptchaType('key', true, true, $localeResolver, 'www.google.com'); } @@ -28,7 +28,7 @@ public function testBuildView(): void { $view = new FormView(); - $form = $this->createMock(FormInterface::class); + $form = $this->createStub(FormInterface::class); $this->assertArrayNotHasKey('leapt_core_recaptcha_enabled', $view->vars); $this->assertArrayNotHasKey('leapt_core_recaptcha_ajax', $view->vars); diff --git a/tests/Form/Type/RecaptchaV3TypeTest.php b/tests/Form/Type/RecaptchaV3TypeTest.php index 29c7f4f3..c5783df4 100755 --- a/tests/Form/Type/RecaptchaV3TypeTest.php +++ b/tests/Form/Type/RecaptchaV3TypeTest.php @@ -24,7 +24,7 @@ public function testBuildView(): void { $view = new FormView(); - $form = $this->createMock(FormInterface::class); + $form = $this->createStub(FormInterface::class); $this->assertArrayNotHasKey('leapt_core_recaptcha_enabled', $view->vars); $this->assertArrayNotHasKey('leapt_core_recaptcha_hide_badge', $view->vars); diff --git a/tests/Listener/FileSubscriberTest.php b/tests/Listener/FileSubscriberTest.php index d9bd9b86..8e94e5d9 100644 --- a/tests/Listener/FileSubscriberTest.php +++ b/tests/Listener/FileSubscriberTest.php @@ -47,7 +47,7 @@ protected function setUp(): void $fileStorageManager = new FileStorageManager( new FilesystemStorage($this->rootDir), new FlysystemStorage([]), - $this->createMock(EventDispatcherInterface::class), + $this->createStub(EventDispatcherInterface::class), ); $this->subscriber = new FileSubscriber($fileStorageManager); @@ -191,11 +191,7 @@ private function buildEntityManager(): EntityManagerInterface { $config = ORMSetup::createConfiguration(true, sys_get_temp_dir()); $config->setMetadataDriverImpl(new AttributeDriver([__DIR__ . '/Fixtures'])); - if (\PHP_VERSION_ID < 80400) { - $config->setAutoGenerateProxyClasses(true); - } else { - $config->enableNativeLazyObjects(true); - } + $config->enableNativeLazyObjects(true); $params = [ 'driver' => 'pdo_sqlite', diff --git a/tests/Paginator/DoctrineORMPaginatorTest.php b/tests/Paginator/DoctrineORMPaginatorTest.php index 41034116..0504a7e7 100644 --- a/tests/Paginator/DoctrineORMPaginatorTest.php +++ b/tests/Paginator/DoctrineORMPaginatorTest.php @@ -35,11 +35,7 @@ public static function setUpBeforeClass(): void $proxiesIdentifier = uniqid('Proxies', true); $config->setProxyDir(sys_get_temp_dir() . '/' . $proxiesIdentifier); $config->setProxyNamespace('MyProject\Proxies\\' . $proxiesIdentifier); - if (\PHP_VERSION_ID < 80400) { - $config->setAutoGenerateProxyClasses(true); - } else { - $config->enableNativeLazyObjects(true); - } + $config->enableNativeLazyObjects(true); $em = new EntityManager(DriverManager::getConnection($dbParams), $config); diff --git a/tests/Twig/Extension/DatalistExtensionTest.php b/tests/Twig/Extension/DatalistExtensionTest.php index 6257121d..09e73898 100644 --- a/tests/Twig/Extension/DatalistExtensionTest.php +++ b/tests/Twig/Extension/DatalistExtensionTest.php @@ -39,10 +39,10 @@ protected function setUp(): void $loader->addPath(__DIR__ . '/../../../templates', 'LeaptCore'); $this->env = new Environment($loader); - $router = $this->createMock(RouterInterface::class); + $router = $this->createStub(RouterInterface::class); $router->method('generate')->willReturn(''); - $requestStack = $this->createMock(RequestStack::class); + $requestStack = $this->createStub(RequestStack::class); $this->extension = new DatalistExtension($requestStack); $this->env->addExtension($this->extension); $this->env->addExtension(new PaginatorExtension('', $requestStack)); @@ -52,9 +52,9 @@ protected function setUp(): void $this->env->addExtension(new AssetExtension(new Packages())); $this->env->addExtension(new FormExtension()); - $formBuilder = $this->createMock(FormBuilderInterface::class); - $formBuilder->method('getForm')->willReturn($this->createMock(FormInterface::class)); - $formFactory = $this->createMock(FormFactoryInterface::class); + $formBuilder = $this->createStub(FormBuilderInterface::class); + $formBuilder->method('getForm')->willReturn($this->createStub(FormInterface::class)); + $formFactory = $this->createStub(FormFactoryInterface::class); $formFactory->method('createNamedBuilder')->willReturn($formBuilder); $this->datalistFactory = new DatalistFactory( diff --git a/tests/Twig/Extension/TextExtensionTest.php b/tests/Twig/Extension/TextExtensionTest.php index d57bd4f1..bacf53c6 100644 --- a/tests/Twig/Extension/TextExtensionTest.php +++ b/tests/Twig/Extension/TextExtensionTest.php @@ -82,7 +82,7 @@ private function assertSafeTruncate(): void $env = $this->getMockBuilder(Environment::class) ->disableOriginalConstructor() ->getMock(); - $env->expects($this->any())->method('getCharset')->willReturn('utf8'); + $env->expects($this->atLeastOnce())->method('getCharset')->willReturn('utf8'); // Simple text $test = 'Lorem ipsum dolor sit amet'; diff --git a/tests/Util/PasswordStrengthCheckerTest.php b/tests/Util/PasswordStrengthCheckerTest.php deleted file mode 100644 index eb5afbcc..00000000 --- a/tests/Util/PasswordStrengthCheckerTest.php +++ /dev/null @@ -1,34 +0,0 @@ -assertEquals(0, $checker->getStrength(''), 'Strength should be equal to 0 when an empty string is provided'); - $this->assertEquals(0, $checker->getStrength('toto', 'toto'), 'Strength should be equal to 0 when the password is the same as the username'); - $this->assertLessThan(10, $checker->getStrength('toto'), 'Strength should be less than 10 when a string with 4 chars and two repetitive syllables is provided'); - $this->assertLessThan(10, $checker->getStrength('dora'), 'Strength should be less than 10 when a string with 4 chars and no repetitive syllable is provided'); - $this->assertLessThan(30, $checker->getStrength('Dora'), 'Strength should be less than 30 when a string with 4 chars and one capital letter is provided'); - $this->assertLessThan(50, $checker->getStrength('dora1'), 'Strength should be less than 50 when a string with 4 chars and 1 digit is provided'); - $this->assertLessThan(50, $checker->getStrength('dora12'), 'Strength should be less than 50 when a string with 4 chars and 2 digits is provided'); - $this->assertLessThan(50, $checker->getStrength('dora*'), 'Strength should be less than 50 when a string with 4 chars and 1 symbol is provided'); - $this->assertLessThan(80, $checker->getStrength('dora1*'), 'Strength should be less than 80 when a string with 4 chars, 1 digit and 1 symbol is provided'); - $this->assertLessThan(80, $checker->getStrength('dora12*'), 'Strength should be less than 90 when a string with 4 chars, 1 digit and 1 symbol is provided'); - $this->assertLessThan(90, $checker->getStrength('Dora12*'), 'Strength should be less than 90 when a string with 4 chars, one capital letter, 1 digit and 1 symbol is provided'); - $this->assertLessThan(90, $checker->getStrength('E=mc^2'), 'Strength should be less than 90 when we use the forumla E=mc^2'); - $this->assertLessThan(90, $checker->getStrength('Doraa12*'), 'Strength should be less than 90 when a string with 5 chars, one capital letter, 1 digit and 1 symbol is provided'); - $this->assertGreaterThan(90, $checker->getStrength('Dor+a12*'), 'Strength should be greater than 90 when a string with 4 chars, one capital letter, 1 digit and 2 symbols is provided'); - $this->assertGreaterThan(90, $checker->getStrength('DorH+a12*5'), 'Strength should be greater than 90 when a string with 5 chars, 2 capital letters, 3 digits and 2 symbols is provided'); - $this->assertEquals(100, $checker->getStrength('DorH+a12*5'), 'Strength should be equal to 100 when a string with 5 chars, 2 capital letters, 3 digits and 2 symbols is provided'); - $this->assertEquals(100, $checker->getStrength('My password is f*cking awesome'), 'Strength should be equal to 100 when it is a long string'); - } -} diff --git a/tests/Validator/PasswordStrengthValidatorTest.php b/tests/Validator/PasswordStrengthValidatorTest.php deleted file mode 100644 index bff456ad..00000000 --- a/tests/Validator/PasswordStrengthValidatorTest.php +++ /dev/null @@ -1,98 +0,0 @@ -validator->validate(null, new PasswordStrength()); - - $this->assertNoViolation(); - } - - public function testEmptyStringIsValid(): void - { - $this->validator->validate('', new PasswordStrength()); - - $this->assertNoViolation(); - } - - #[DataProvider('getValidPasswords')] - public function testValidPassword(string $password): void - { - $this->validator->validate($password, new PasswordStrength(min: 5, max: 255, score: 50)); - $this->assertNoViolation(); - } - - public static function getValidPasswords(): iterable - { - yield ['dora1*']; - yield ['dora12*']; - yield ['Dora12*']; - yield ['E=mc^2']; - yield ['Doraa12*']; - yield ['Dor+a12*']; - yield ['DorH+a12*5']; - yield ['DorH+a12*5']; - yield ['My password is f*cking awesome']; - } - - #[DataProvider('getInvalidPasswords')] - public function testInvalidPasswords(string $password): void - { - $constraint = new PasswordStrength(score: 50, scoreMessage: 'scoreMessage'); - - $this->validator->validate($password, $constraint); - - $this->buildViolation('scoreMessage') - ->assertRaised(); - } - - public static function getInvalidPasswords(): iterable - { - yield ['toto']; - yield ['dora']; - yield ['Dora']; - } - - public function testMinPasswords(): void - { - $constraint = new PasswordStrength( - min: 5, - minMessage: 'minMessage', - score: 50, - ); - $this->validator->validate('abc', $constraint); - - $this->buildViolation('minMessage') - ->setParameter('{{ limit }}', '5') - ->assertRaised(); - } - - public function testMaxPasswords(): void - { - $constraint = new PasswordStrength( - max: 5, - maxMessage: 'maxMessage', - score: 50, - ); - $this->validator->validate('abcdefgh', $constraint); - - $this->buildViolation('maxMessage') - ->setParameter('{{ limit }}', '5') - ->assertRaised(); - } - - protected function createValidator(): PasswordStrengthValidator - { - return new PasswordStrengthValidator(); - } -} diff --git a/translations/validators.en.yml b/translations/validators.en.yml index 23f9ae7b..54948b9c 100644 --- a/translations/validators.en.yml +++ b/translations/validators.en.yml @@ -3,6 +3,3 @@ "The submitted captcha is invalid.": The submitted captcha is invalid. "The submitted captcha is invalid. Error codes: {{ errorCodes }}. Score: {{ score }}.": "The submitted captcha is invalid. Error codes: {{ errorCodes }}. Score: {{ score }}." "A slug can only contain lowercase letters, numbers and hyphens.": A slug can only contain lowercase letters, numbers and hyphens. -"This password is not strong enough.": This password is not strong enough. -"This password is too short. It should have {{ limit }} characters or more.": This password is too short. It should have {{ limit }} characters or more. -"This password is too long. It should have {{ limit }} characters or less.": This password is too long. It should have {{ limit }} characters or less. diff --git a/translations/validators.fr.yml b/translations/validators.fr.yml index c4e3773f..8c5c82d1 100644 --- a/translations/validators.fr.yml +++ b/translations/validators.fr.yml @@ -3,6 +3,3 @@ "The submitted captcha is invalid.": Le captcha envoyé est invalide, veuillez réessayer. "The submitted captcha is invalid. Error codes: {{ errorCodes }}. Score: {{ score }}.": "Le captcha envoyé est invalide. Codes d'erreur : {{ errorCodes }}. Score : {{ score }}." "A slug can only contain lowercase letters, numbers and hyphens.": Un slug ne peut contenir que des lettres minuscules sans accents, des chiffres et des tirets. -"This password is not strong enough.": Le mot de passe n'est pas assez fort. -"This password is too short. It should have {{ limit }} characters or more.": Le mot de passe est trop court et doit contenir au moins {{ limit }} caractères. -"This password is too long. It should have {{ limit }} characters or less.": Le mot de passe est trop long et doit contenir {{ limit }} caractères ou moins.