Skip to content

Commit

Permalink
Merge pull request #259 from openeuropa/EWPP-4991
Browse files Browse the repository at this point in the history
EWPP-4991: Ensure PHP8.3 compatibility.
  • Loading branch information
nagyad authored Jan 23, 2025
2 parents 1b11138 + 9a1426c commit e690094
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 49 deletions.
14 changes: 7 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ services:
- DOCUMENT_ROOT=/test/oe_webtools
- COMPOSERVER=--2
mysql:
image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/percona:5.7
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3
image: git.fpfis.tech.ec.europa.eu/fpfis/dependency_proxy/containers/percona:8.0
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 --skip-log-bin --innodb-flush-log-at-trx-commit=2 --innodb-read-io-threads=16 --innodb-write-io-threads=16
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
selenium:
Expand Down Expand Up @@ -84,11 +84,11 @@ pipeline:

matrix:
include:
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.2.0
PHP_VERSION: 8.2
- CORE_VERSION: 10.3.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.3.0
PHP_VERSION: 8.2
PHP_VERSION: 8.3
- CORE_VERSION: 10.4.0
PHP_VERSION: 8.1
- CORE_VERSION: 10.4.0
PHP_VERSION: 8.3
24 changes: 17 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"drush/drush": "^12",
"mikey179/vfsstream": "^1.6",
"openeuropa/behat-transformation-context": "^0.2",
"openeuropa/code-review": "^2.0.0-alpha6",
"openeuropa/code-review-drupal": "^1.0.0-alpha",
"openeuropa/oe_media": "^1.23",
"openeuropa/oe_multilingual": "^1.13",
"openeuropa/rdf_skos": "^1.0.0-alpha10",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"openeuropa/webtools-geocoding-provider": "^0.3",
"phpspec/prophecy-phpunit": "^2",
"symfony/phpunit-bridge": "^6.2",
Expand All @@ -38,12 +38,20 @@
"post-install-cmd": "./vendor/bin/run drupal:site-setup",
"post-update-cmd": "./vendor/bin/run drupal:site-setup"
},
"repositories": {
"drupal": {
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "git",
"url": "https://github.com/openeuropa/DrupalDriver.git"
},
{
"type": "git",
"url": "https://github.com/openeuropa/code-review-drupal.git"
}
},
],
"autoload": {
"psr-4": {
"Drupal\\oe_webtools\\": "./src/"
Expand Down Expand Up @@ -79,10 +87,12 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"php-http/discovery": false,
"phpro/grumphp": true,
"php-http/discovery": false
"phpro/grumphp-shim": true,
"phpstan/extension-installer": true
}
}
}
7 changes: 3 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '2'
services:
web:
image: fpfis/httpd-php-dev:8.1
image: fpfis/httpd-php-dev:8.3
working_dir: /var/www/html
ports:
- 8080:8080
Expand All @@ -17,8 +16,8 @@ services:
# Enable step debugging for all PHP request. See ./README.md#step-debugging for more information.
# XDEBUG_SESSION: 1
mysql:
image: percona/percona-server:5.7
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3
image: percona/percona-server:8.0
command: --innodb-log-file-size=1G --max_allowed_packet=1G --innodb-buffer-pool-size=512M --wait_timeout=3000 --net_write_timeout=3000 --log_error_verbosity=3 --skip-log-bin --innodb-flush-log-at-trx-commit=2 --innodb-read-io-threads=16 --innodb-write-io-threads=16
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
# ports:
Expand Down
35 changes: 7 additions & 28 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
imports:
- { resource: vendor/openeuropa/code-review/dist/drupal-conventions.yml }
parameters:
tasks.phpcs.ignore_patterns:
- vendor/
- node_modules/
- build/
tasks.phpcs.triggered_by:
- php
- module
- inc
- module
- install

extra_tasks:
- { resource: ./vendor/openeuropa/code-review-drupal/dist/oe-component-conventions.yml }
grumphp:
tasks:
phpparser:
ignore_patterns:
- vendor/
- build/
visitors:
declare_strict_types: ~
triggered_by:
- php
- module
- inc
- theme
- install

grumphp:
- vendor/
git_hook_variables:
EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web'
extensions:
- OpenEuropa\CodeReview\ExtraTasksExtension

parameters:
tasks.phpstan.configuration: phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ oe_webtools_cookie_consent.settings:
base_route_name: oe_webtools_cookie_consent.settings
names:
- oe_webtools_cookie_consent.settings

3 changes: 2 additions & 1 deletion modules/oe_webtools_media/oe_webtools_media.install
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
declare(strict_types=1);

use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileExists;
use Drupal\Core\File\FileSystemInterface;

/**
Expand All @@ -33,7 +34,7 @@ function oe_webtools_media_install() {
// possible to copy the files is also confusing, we silently do nothing.
if (!file_exists($destination . DIRECTORY_SEPARATOR . $file->filename)) {
try {
$file_system->copy($file->uri, $destination, FileSystemInterface::EXISTS_ERROR);
$file_system->copy($file->uri, $destination, FileExists::Error);
}
catch (FileException $e) {
// Ignore and continue.
Expand Down
3 changes: 2 additions & 1 deletion modules/oe_webtools_media/oe_webtools_media.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
declare(strict_types=1);

use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileExists;
use Drupal\Core\File\FileSystemInterface;
use Drupal\media\Entity\MediaType;

Expand All @@ -27,7 +28,7 @@ function oe_webtools_media_post_update_00001(): void {
foreach ($files as $file) {
if (!file_exists($destination . DIRECTORY_SEPARATOR . $file->filename)) {
try {
$file_system->copy($file->uri, $destination, FileSystemInterface::EXISTS_ERROR);
$file_system->copy($file->uri, $destination, FileExists::Error);
}
catch (FileException $e) {
// Ignore and continue.
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
includes:
- ./vendor/openeuropa/code-review-drupal/dist/phpstan.drupal.neon

0 comments on commit e690094

Please sign in to comment.