Skip to content

Commit

Permalink
Upgrade to php8
Browse files Browse the repository at this point in the history
This updates the php version and fixes
regexes that became incompatible.
  • Loading branch information
Abban committed Jul 6, 2021
1 parent 2ec2465 commit 8fa812e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "GPL-2.0-or-later",
"description": "General and shared validation services created as part of the WMDE fundraising software",
"require": {
"php": ">=7.2"
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "~9.5.1",
Expand Down
28 changes: 14 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.4'

services:
fun-validators:
image: wikimediade/fundraising-frontend:dev
image: "registry.gitlab.com/fun-tech/fundraising-frontend-docker:latest"
volumes:
- ./:/usr/src/app
working_dir: /usr/src/app
2 changes: 1 addition & 1 deletion src/Validators/TextPolicyValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function hasDeniedWordNotMatchingAllowedWords( array $deniedMatches, arr
$deniedMatches,
$allowedMatches,
function ( $deniedMatch, $allowedMatch ) {
return !preg_match( $this->composeRegex( [ $deniedMatch ] ), $allowedMatch );
return (int)!preg_match( $this->composeRegex( [ $deniedMatch ] ), $allowedMatch );
}
)
) > 0;
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Validators/AddressValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class AddressValidatorTest extends TestCase {
];

private const ADDRESS_PATTERNS = [
'firstName' => "/^[A-Za-z\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff\\s\\-\\.\\']+$/",
'lastName' => "/^[A-Za-z\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff\\s\\-\\.\\']+$/",
'firstName' => "/^[A-Za-z\x{00C0}-\x{00D6}\x{00D8}-\x{00f6}\x{00f8}-\x{00ff}\\s\\-\\.\\']+$/",
'lastName' => "/^[A-Za-z\x{00C0}-\x{00D6}\x{00D8}-\x{00f6}\x{00f8}-\x{00ff}\\s\\-\\.\\']+$/",
'postcode' => '/^.+$/',
];

Expand Down

0 comments on commit 8fa812e

Please sign in to comment.