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

EWPP-4991: Ensure PHP8.3 compatibility. #98

Merged
merged 1 commit into from
Jan 29, 2025
Merged
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
14 changes: 7 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ services:
- DOCUMENT_ROOT=/test/rdf_skos
- 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
sparql:
Expand Down Expand Up @@ -73,11 +73,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
16 changes: 13 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"mikey179/vfsstream": "^1.6.10",
"nikic/php-parser": "^4",
"openeuropa/behat-transformation-context": "^0.2",
"openeuropa/code-review": "^2.0.0-alpha6",
"openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6",
"openeuropa/code-review-drupal": "^1.0.0-alpha",
"openeuropa/task-runner-drupal-project-symlink": "^1.0",
"phpspec/prophecy-phpunit": "^2",
"symfony/phpunit-bridge": "^6.2"
},
Expand All @@ -41,6 +41,14 @@
{
"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"
}
],
"extra": {
Expand Down Expand Up @@ -70,7 +78,9 @@
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"phpro/grumphp": true
"phpro/grumphp": true,
"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 @@ -16,8 +15,8 @@ services:
# For Mac users: sudo ifconfig en0 alias 10.254.254.254 255.255.255.0
# For Linux users: sudo ip addr add 10.254.254.254/32 dev lo label lo: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
34 changes: 6 additions & 28 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
imports:
- { resource: vendor/openeuropa/code-review/dist/drupal-conventions.yml }

- { resource: ./vendor/openeuropa/code-review-drupal/dist/oe-component-conventions.yml }
grumphp:
tasks:
phpparser:
ignore_patterns:
- vendor/
git_hook_variables:
EXEC_GRUMPHP_COMMAND: 'docker-compose exec -T web'
extensions:
- OpenEuropa\CodeReview\ExtraTasksExtension

parameters:
tasks.phpcs.ignore_patterns:
- vendor/
- build/
tasks.phpcs.triggered_by:
- php
- module
- inc
- theme
- install

extra_tasks:
phpparser:
ignore_patterns:
- vendor/
- build/
visitors:
declare_strict_types: ~
triggered_by:
- php
- module
- inc
- theme
- install

tasks.phpstan.configuration: phpstan.neon.dist
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
2 changes: 2 additions & 0 deletions src/ConceptHtmlRouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ protected function getSettingsFormRoute(EntityTypeInterface $entity_type):? Rout

return $route;
}

return NULL;
}

}
2 changes: 2 additions & 0 deletions src/ConceptSchemeHtmlRouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ protected function getSettingsFormRoute(EntityTypeInterface $entity_type):? Rout

return $route;
}

return NULL;
}

}
2 changes: 1 addition & 1 deletion src/ConceptSubsetInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public function label(): string;
* @param string|null $match
* The value to match.
*/
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void;
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void;

}
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ protected function buildConceptSubsetElement(array $form, FormStateInterface $fo
* @param string|null $match
* The value to match.
*/
protected function applyConceptSubset(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void {
protected function applyConceptSubset(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void {
$configuration = $this->getConfiguration();
if (!$configuration['concept_subset']) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/views/filter/SkosConceptReferenceId.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function create(ContainerInterface $container, array $configuratio
/**
* {@inheritdoc}
*/
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) {
parent::init($view, $display, $options);

if (!empty($this->definition['concept_scheme'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/RdfSkosGraphHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getGraphDefinitions(string $entity_type_id): array {
/**
* {@inheritdoc}
*/
public function getEntityTypeGraphUris(string $entity_type_id, array $limit_to_graph_ids = NULL): array {
public function getEntityTypeGraphUris(string $entity_type_id, ?array $limit_to_graph_ids = NULL): array {
if (isset($this->cache['structure'][$entity_type_id])) {
return $this->cache['structure'][$entity_type_id];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AnySchemeAlterSubset extends ConceptSubsetPluginBase {
/**
* {@inheritdoc}
*/
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void {
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void {
// We don't actually alter the query but use this plugin to test that it
// is always available.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FruitSchemeAlterSubset extends ConceptSubsetPluginBase {
/**
* {@inheritdoc}
*/
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void {
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void {
// Allow only one fruit in this subset.
$query->condition('id', 'http://example.com/fruit/citrus-fruit');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MultiSchemeAlterSubset extends ConceptSubsetPluginBase {
/**
* {@inheritdoc}
*/
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void {
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void {
// Perform no alteration.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PredicateMappingSubset extends ConceptSubsetPluginBase implements Predicat
/**
* {@inheritdoc}
*/
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], string $match = NULL): void {
public function alterQuery(QueryInterface $query, $match_operator, array $concept_schemes = [], ?string $match = NULL): void {
// We don't need to alter the query for this test.
}

Expand Down
4 changes: 2 additions & 2 deletions tests/modules/rdf_skos_test/src/TestSkosEntityStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ public function disableStaticCache(): void {
/**
* {@inheritdoc}
*/
protected function doLoadMultiple(array $ids = NULL, array $graph_ids = []) {
protected function doLoadMultiple(?array $ids = NULL, array $graph_ids = []) {
$this->loads[] = $ids;
return parent::doLoadMultiple($ids, $graph_ids);
}

/**
* {@inheritdoc}
*/
protected function getFromStorage(array $ids = NULL, array $graph_ids = []): array {
protected function getFromStorage(?array $ids = NULL, array $graph_ids = []): array {
$this->storageLoads[] = $ids;
return parent::getFromStorage($ids, $graph_ids);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Traits/SkosEntityReferenceTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait SkosEntityReferenceTrait {
* @param string|null $concept_subset
* An optional concept subset plugin.
*/
protected function createSkosConceptReferenceField(string $entity_type, string $bundle, array $concept_schemes, string $field_name, string $field_label, string $widget = NULL, string $concept_subset = NULL): void {
protected function createSkosConceptReferenceField(string $entity_type, string $bundle, array $concept_schemes, string $field_name, string $field_label, ?string $widget = NULL, ?string $concept_subset = NULL): void {
$handler_settings = [
'target_bundles' => NULL,
'auto_create' => FALSE,
Expand Down