From 7e994fa3632a1269077905d16555cb6d602ef491 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 3 Apr 2023 09:44:35 -0700 Subject: [PATCH] PHP 8.1 compatibility (#3927) * 13523/14184 --- .codeclimate.yml | 65 +++++++++---------- composer.json | 10 +-- .../src/Unit/Reference/ReferencerTest.php | 12 ++-- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 890420be65..7f749ff32a 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -6,36 +6,35 @@ plugins: config: standard: "Drupal,DrupalPractice" exclude_patterns: - - "cypress/" - - "config/" - - "db/" - - "dist/" - - "docs/" - - "documentation/" - - "features/" - - "**/node_modules/" - - "script/" - - "**/spec/" - - "**/test/" - - "**/tests/" - - "Tests/" - - "**/vendor/" - - "**/*_test.go" - - "**/*.d.ts" - - "**/*.yml" - - "**/*.json" - - "**/*.js" - - "**/*.jsx" - - "*.md" - - "**/*.md" - - "*.install" - - "*.profile" - - "*.module" - - "*.xml" - - "**/*.xml" - - "**/*.install" - - "**/*.profile" - - "**/*.module" - - ".circleci/" - - ".gitignore" - \ No newline at end of file + - "cypress/" + - "config/" + - "db/" + - "dist/" + - "docs/" + - "documentation/" + - "features/" + - "**/node_modules/" + - "script/" + - "**/spec/" + - "**/test/" + - "**/tests/" + - "Tests/" + - "**/vendor/" + - "**/*_test.go" + - "**/*.d.ts" + - "**/*.yml" + - "**/*.json" + - "**/*.js" + - "**/*.jsx" + - "*.md" + - "**/*.md" + - "*.install" + - "*.profile" + - "*.module" + - "*.xml" + - "**/*.xml" + - "**/*.install" + - "**/*.profile" + - "**/*.module" + - ".circleci/" + - ".gitignore" diff --git a/composer.json b/composer.json index 1eddb981b2..a836efa269 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "description": "DKAN Open Data Catalog", "require": { "drupal/admin_toolbar": "^3", - "drupal/config_update": "^1.6", + "drupal/config_update": "^2@dev", "drupal/moderated_content_bulk_publish": "~2.0.20", "drupal/search_api": "^1.15", "drupal/select_or_other": "dev-4.x#ae0585ff8c", @@ -14,16 +14,16 @@ "drupal/views_bulk_operations": "^4.0", "ext-json": "*", "ezyang/htmlpurifier" : "^4.11", - "fmizzell/maquina": "^1.1.0", + "fmizzell/maquina": "^1.1.1", "getdkan/contracts": "^1.0.0", - "getdkan/csv-parser": "^1.2.3", - "getdkan/file-fetcher" : "4.2.0", + "getdkan/csv-parser": "^1.3.0", + "getdkan/file-fetcher" : "^4.2.1", "getdkan/harvest": "^1.0.0", "getdkan/json-schema-provider": "^0.1.2", "getdkan/locker": "^1.1.0", "getdkan/procrastinator": "^4.0.0", "getdkan/rooted-json-data": "^0.1", - "getdkan/sql-parser": "^2.0.0", + "getdkan/sql-parser": "^2.1.0", "guzzlehttp/guzzle" : "^6.5.8 || ^7.4.5", "ilbee/csv-response": "^1.1.1", "m1x0n/opis-json-schema-error-presenter": "^0.5.3", diff --git a/modules/metastore/tests/src/Unit/Reference/ReferencerTest.php b/modules/metastore/tests/src/Unit/Reference/ReferencerTest.php index 2b4871374f..ffeb868e73 100644 --- a/modules/metastore/tests/src/Unit/Reference/ReferencerTest.php +++ b/modules/metastore/tests/src/Unit/Reference/ReferencerTest.php @@ -23,7 +23,7 @@ use Drupal\node\Entity\Node; use Drupal\node\NodeStorage; -use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; use MockChain\Chain; use MockChain\Options; use PHPUnit\Framework\TestCase; @@ -38,23 +38,23 @@ class ReferencerTest extends TestCase { * * @var string */ - const FILE_PATH = 'tmp/mycsv.csv'; + public const FILE_PATH = 'tmp/mycsv.csv'; /** * HTTP host protocol and domain for testing download URL. * * @var string */ - const HOST = 'http://example.com'; + public const HOST = 'http://example.com'; - const MIME_TYPE = 'text/csv'; + public const MIME_TYPE = 'text/csv'; /** * List referenceable dataset properties. * * @var string[] */ - const REFERENCEABLE_PROPERTY_LIST = [ + public const REFERENCEABLE_PROPERTY_LIST = [ 'keyword' => 0, 'distribution' => 'distribution', 'title' => 0, @@ -452,7 +452,7 @@ public function getMimeType() { return ReferencerTest::MIME_TYPE; } $this->assertEquals(self::MIME_TYPE, $container_chain->getStoredInput('resource')[0]->getMimeType(), 'Unable to fetch MIME type for remote file'); // Test Mime Type detection on a invalid remote file path. $data = $this->getData('http://invalid'); - $this->expectException(RequestException::class); + $this->expectException(ConnectException::class); $referencer->reference($data); }