From 756d7ac2d7fd533a3ce0cb1dab391b0cdf2fc4c5 Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:09:02 +0100
Subject: [PATCH 1/7] Add attributes for RdfUriGenerator

---
 src/Attribute/RdfUriGenerator.php             | 21 +++++++++++++++++++
 .../DefaultRdfUriGenerator.php                | 11 +++++-----
 src/RdfUriGeneratorPluginManager.php          |  2 +-
 3 files changed, 28 insertions(+), 6 deletions(-)
 create mode 100644 src/Attribute/RdfUriGenerator.php

diff --git a/src/Attribute/RdfUriGenerator.php b/src/Attribute/RdfUriGenerator.php
new file mode 100644
index 0000000..24662e2
--- /dev/null
+++ b/src/Attribute/RdfUriGenerator.php
@@ -0,0 +1,21 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Drupal\rdf_sync\Attribute;
+
+use Drupal\Component\Plugin\Attribute\Plugin;
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+
+/**
+ * Defines an RdfUriGenerator.
+ */
+#[\Attribute(\Attribute::TARGET_CLASS)]
+class RdfUriGenerator extends Plugin {
+
+  public function __construct(
+    public readonly string $id,
+    public readonly TranslatableMarkup $label,
+  ) {}
+
+}
diff --git a/src/Plugin/rdf_sync/RdfUriGenerator/DefaultRdfUriGenerator.php b/src/Plugin/rdf_sync/RdfUriGenerator/DefaultRdfUriGenerator.php
index 4f9dfd9..977abaf 100644
--- a/src/Plugin/rdf_sync/RdfUriGenerator/DefaultRdfUriGenerator.php
+++ b/src/Plugin/rdf_sync/RdfUriGenerator/DefaultRdfUriGenerator.php
@@ -4,16 +4,17 @@ declare(strict_types=1);
 
 namespace Drupal\rdf_sync\Plugin\rdf_sync\RdfUriGenerator;
 
+use Drupal\Core\StringTranslation\TranslatableMarkup;
+use Drupal\rdf_sync\Attribute\RdfUriGenerator;
 use Drupal\rdf_sync\RdfUriGeneratorPluginBase;
 
 /**
  * Provides a fallback entity ID generator plugin.
- *
- * @RdfUriGenerator(
- *   id = "default",
- *   name = @Translation("Default URI generator"),
- * )
  */
+#[RdfUriGenerator(
+  id: "default",
+  label: new TranslatableMarkup("Default URI generator"),
+)]
 class DefaultRdfUriGenerator extends RdfUriGeneratorPluginBase {
 
   /**
diff --git a/src/RdfUriGeneratorPluginManager.php b/src/RdfUriGeneratorPluginManager.php
index 3ae9588..6cb67a6 100644
--- a/src/RdfUriGeneratorPluginManager.php
+++ b/src/RdfUriGeneratorPluginManager.php
@@ -8,7 +8,7 @@ use Drupal\Component\Plugin\FallbackPluginManagerInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
-use Drupal\rdf_sync\Annotation\RdfUriGenerator;
+use Drupal\rdf_sync\Attribute\RdfUriGenerator;
 
 /**
  * Plugin manager for RDF URI generator plugins.
-- 
GitLab


From 9afd0fa8d93ee36d0515f69c406880f22d41050e Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:18:50 +0100
Subject: [PATCH 2/7] Add docblock.

---
 src/Attribute/RdfUriGenerator.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Attribute/RdfUriGenerator.php b/src/Attribute/RdfUriGenerator.php
index 24662e2..f127188 100644
--- a/src/Attribute/RdfUriGenerator.php
+++ b/src/Attribute/RdfUriGenerator.php
@@ -13,6 +13,14 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
 #[\Attribute(\Attribute::TARGET_CLASS)]
 class RdfUriGenerator extends Plugin {
 
+  /**
+   * Constructs an RDF URI generator attribute.
+   *
+   * @param string $id
+   *   The plugin ID.
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
+   *   The human-readable name of the widget type.
+   */
   public function __construct(
     public readonly string $id,
     public readonly TranslatableMarkup $label,
-- 
GitLab


From 1d12526a1df46c8664276ff7ffa4c4168e720b1d Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:24:34 +0100
Subject: [PATCH 3/7] This annotation is scheduled for removal.

---
 src/Annotation/RdfUriGenerator.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/Annotation/RdfUriGenerator.php b/src/Annotation/RdfUriGenerator.php
index 7668062..3e7822c 100644
--- a/src/Annotation/RdfUriGenerator.php
+++ b/src/Annotation/RdfUriGenerator.php
@@ -10,6 +10,9 @@ use Drupal\Core\Annotation\Translation;
 /**
  * Defines an RDF URI generator plugin annotation.
  *
+ * @deprecated This annotation is scheduled for removal.
+ *  Use \Drupal\rdf_sync\Attribute\RdfUriGenerator instead.
+ *
  * @see plugin_api
  *
  * @ingroup plugin_api
-- 
GitLab


From 70e43c00451a00bee227e8f055fc0e7a10a79501 Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:29:22 +0100
Subject: [PATCH 4/7] Revert "This annotation is scheduled for removal."

This reverts commit 1d12526a1df46c8664276ff7ffa4c4168e720b1d.
---
 src/Annotation/RdfUriGenerator.php | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/Annotation/RdfUriGenerator.php b/src/Annotation/RdfUriGenerator.php
index 3e7822c..7668062 100644
--- a/src/Annotation/RdfUriGenerator.php
+++ b/src/Annotation/RdfUriGenerator.php
@@ -10,9 +10,6 @@ use Drupal\Core\Annotation\Translation;
 /**
  * Defines an RDF URI generator plugin annotation.
  *
- * @deprecated This annotation is scheduled for removal.
- *  Use \Drupal\rdf_sync\Attribute\RdfUriGenerator instead.
- *
  * @see plugin_api
  *
  * @ingroup plugin_api
-- 
GitLab


From b931684835f8fe65fb219809d1e664ef9d458fbd Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:29:27 +0100
Subject: [PATCH 5/7] Revert "Add docblock."

This reverts commit 9afd0fa8d93ee36d0515f69c406880f22d41050e.
---
 src/Attribute/RdfUriGenerator.php | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/Attribute/RdfUriGenerator.php b/src/Attribute/RdfUriGenerator.php
index f127188..24662e2 100644
--- a/src/Attribute/RdfUriGenerator.php
+++ b/src/Attribute/RdfUriGenerator.php
@@ -13,14 +13,6 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
 #[\Attribute(\Attribute::TARGET_CLASS)]
 class RdfUriGenerator extends Plugin {
 
-  /**
-   * Constructs an RDF URI generator attribute.
-   *
-   * @param string $id
-   *   The plugin ID.
-   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
-   *   The human-readable name of the widget type.
-   */
   public function __construct(
     public readonly string $id,
     public readonly TranslatableMarkup $label,
-- 
GitLab


From d87b880d32860a81b1184fec7497629b748b7209 Mon Sep 17 00:00:00 2001
From: Adrian Lorenc <adrian.lorenc@gmail.com>
Date: Tue, 4 Mar 2025 17:32:08 +0100
Subject: [PATCH 6/7] Reapply "Add docblock."

This reverts commit b931684835f8fe65fb219809d1e664ef9d458fbd.
---
 src/Attribute/RdfUriGenerator.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Attribute/RdfUriGenerator.php b/src/Attribute/RdfUriGenerator.php
index 24662e2..f127188 100644
--- a/src/Attribute/RdfUriGenerator.php
+++ b/src/Attribute/RdfUriGenerator.php
@@ -13,6 +13,14 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
 #[\Attribute(\Attribute::TARGET_CLASS)]
 class RdfUriGenerator extends Plugin {
 
+  /**
+   * Constructs an RDF URI generator attribute.
+   *
+   * @param string $id
+   *   The plugin ID.
+   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
+   *   The human-readable name of the widget type.
+   */
   public function __construct(
     public readonly string $id,
     public readonly TranslatableMarkup $label,
-- 
GitLab


From 5478b6d65ed8f3633945fa3b0db80086d92ed70c Mon Sep 17 00:00:00 2001
From: "micha.jakubowski" <micha.jakubowski@ffwagency.com>
Date: Wed, 5 Mar 2025 10:48:18 +0100
Subject: [PATCH 7/7] Support for attributes and annotations in parent
 constructor od RdfUriGeneratorPluginManager.php

---
 src/RdfUriGeneratorPluginManager.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/RdfUriGeneratorPluginManager.php b/src/RdfUriGeneratorPluginManager.php
index 6cb67a6..a4f8b51 100644
--- a/src/RdfUriGeneratorPluginManager.php
+++ b/src/RdfUriGeneratorPluginManager.php
@@ -8,7 +8,8 @@ use Drupal\Component\Plugin\FallbackPluginManagerInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Plugin\DefaultPluginManager;
-use Drupal\rdf_sync\Attribute\RdfUriGenerator;
+use Drupal\rdf_sync\Annotation\RdfUriGenerator as AnnotationRdfUriGenerator;
+use Drupal\rdf_sync\Attribute\RdfUriGenerator as AttributeRdfUriGenerator;
 
 /**
  * Plugin manager for RDF URI generator plugins.
@@ -27,7 +28,8 @@ class RdfUriGeneratorPluginManager extends DefaultPluginManager implements Fallb
    *   The module handler.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
-    parent::__construct('Plugin/rdf_sync/RdfUriGenerator', $namespaces, $module_handler, RdfUriGeneratorPluginInterface::class, RdfUriGenerator::class);
+    parent::__construct('Plugin/rdf_sync/RdfUriGenerator', $namespaces, $module_handler, RdfUriGeneratorPluginInterface::class,
+      AttributeRdfUriGenerator::class, AnnotationRdfUriGenerator::class);
     $this->alterInfo('rdf_uri_generator_info');
     $this->setCacheBackend($cache_backend, 'rdf_uri_generator_plugins');
   }
-- 
GitLab