diff --git a/composer.json b/composer.json index d2910799592a70c4398ece1523e7e852d1f921cf..702449d579bdb6fdbdb0c38291800add5a3521c5 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "symfony/lock": "^5.4", "symfony/browser-kit": "^5.4", "symfony/dom-crawler": "^5.4", - "easyrdf/easyrdf": "^0.9 || ^1.0" + "easyrdf/easyrdf": "^1.0" }, "replace": { "symfony/polyfill-php72": "*", diff --git a/composer.lock b/composer.lock index 4ed8369080aae451c71c4b2fa7dfd959e193918b..9de732b9737d6c74da4501052aa28e5deccf7aa8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "210789b4f85a82f083006db5aeafc33d", + "content-hash": "37d8d1300ab9c7bcc69ee336d9aa26d7", "packages": [ { "name": "asm89/stack-cors", diff --git a/composer/Metapackage/DevDependencies/composer.json b/composer/Metapackage/DevDependencies/composer.json index 3fce8801d60ed1accbbb52da27336885b4fcf9a1..8d3a1b9b3c25fee96312559e4ad26bc0707acf86 100644 --- a/composer/Metapackage/DevDependencies/composer.json +++ b/composer/Metapackage/DevDependencies/composer.json @@ -11,7 +11,7 @@ "behat/mink-selenium2-driver": "^1.4", "composer/composer": "^2.0.2", "drupal/coder": "^8.3.10", - "easyrdf/easyrdf": "^0.9 || ^1.0", + "easyrdf/easyrdf": "^1.0", "friends-of-behat/mink-browserkit-driver": "^1.4", "instaclick/php-webdriver": "^1.4.1", "justinrainbow/json-schema": "^5.2", diff --git a/core/modules/rdf/tests/src/Traits/RdfParsingTrait.php b/core/modules/rdf/tests/src/Traits/RdfParsingTrait.php index 92fd6aba7a688bb63b1b5889810ab206bd02484c..5c891f7e46747013d1e310ba4159f5939c750731 100644 --- a/core/modules/rdf/tests/src/Traits/RdfParsingTrait.php +++ b/core/modules/rdf/tests/src/Traits/RdfParsingTrait.php @@ -37,8 +37,8 @@ trait RdfParsingTrait { * @throws \EasyRdf\Exception */ protected function hasRdfProperty($html, $base_uri, $resource, $property, array $value) { - $parser = $this->getInstanceParser(); - $graph = $this->getInstanceGraph(); + $parser = new Rdfa(); + $graph = new Graph(); $parser->parse($graph, $html, 'rdfa', $base_uri); return $graph->hasProperty($resource, $property, $value); @@ -72,8 +72,8 @@ protected function hasRdfProperty($html, $base_uri, $resource, $property, array * @throws \EasyRdf\Exception */ protected function hasRdfChildProperty($html, $base_uri, $resource, $parent_property, string $child_property, array $value) { - $parser = $this->getInstanceParser(); - $graph = $this->getInstanceGraph(); + $parser = new Rdfa(); + $graph = new Graph(); $parser->parse($graph, $html, 'rdfa', $base_uri); $node = $graph->get($resource, $parent_property); return $graph->hasProperty($node, $child_property, $value); @@ -95,8 +95,8 @@ protected function hasRdfChildProperty($html, $base_uri, $resource, $parent_prop * @throws \EasyRdf\Exception */ protected function getElementByRdfTypeCount(Url $url, $base_uri, $type) { - $parser = $this->getInstanceParser(); - $graph = $this->getInstanceGraph(); + $parser = new Rdfa(); + $graph = new Graph(); $parser->parse($graph, $this->drupalGet($url), 'rdfa', $base_uri); return count($graph->allOfType($type)); } @@ -117,8 +117,8 @@ protected function getElementByRdfTypeCount(Url $url, $base_uri, $type) { * @throws \EasyRdf\Exception */ protected function getElementRdfType(Url $url, $base_uri, $resource_uri) { - $parser = $this->getInstanceParser(); - $graph = $this->getInstanceGraph(); + $parser = new Rdfa(); + $graph = new Graph(); $parser->parse($graph, $this->drupalGet($url), 'rdfa', $base_uri); return $graph->type($resource_uri); } @@ -141,42 +141,10 @@ protected function getElementRdfType(Url $url, $base_uri, $resource_uri) { * @throws \EasyRdf\Exception */ protected function rdfElementIsBlankNode($html, $base_uri, $resource_uri, $property) { - $parser = $this->getInstanceParser(); - $graph = $this->getInstanceGraph(); + $parser = new Rdfa(); + $graph = new Graph(); $parser->parse($graph, $html, 'rdfa', $base_uri); return $graph->get($resource_uri, $property)->isBnode(); } - /** - * Gets a new instance of EasyRdf\Parser\Rdfa or EasyRdf_Parser_Rdfa. - * - * @return \EasyRdf\Parser\Rdfa|\EasyRdf_Parser_Rdfa - * The instance. - * - * @todo Clean this up in drupal:10.0.0. - * @see https://www.drupal.org/node/3176468 - */ - private function getInstanceParser() { - if (class_exists('EasyRdf\Parser\Rdfa')) { - return new Rdfa(); - } - return new \EasyRdf_Parser_Rdfa(); - } - - /** - * Gets a new instance of EasyRdf\Graph or EasyRdf_Graph. - * - * @return \EasyRdf\Graph|\EasyRdf_Graph - * The instance. - * - * @todo Clean this up in drupal:10.0.0. - * @see https://www.drupal.org/node/3176468 - */ - private function getInstanceGraph() { - if (class_exists('EasyRdf\Graph')) { - return new Graph(); - } - return new \EasyRdf_Graph(); - } - } diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 810464293b20d618da0b2cee9083fc4fa6851ed6..ed1f1e98a865f4b0cc8929fdfe42c39c8ef3c798 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -605,96 +605,6 @@ parameters: count: 1 path: modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/CommentAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/CommentAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/FileFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/FileFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/ImageFieldAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/NodeAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/NodeAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/StandardProfileTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/StandardProfileTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/TaxonomyAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/UserAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Functional/UserAttributesTest.php - - - - message: "#^Instantiated class EasyRdf_Graph not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php - - - - message: "#^Instantiated class EasyRdf_Parser_Rdfa not found\\.$#" - count: 1 - path: modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 1