Skip to content

Commit

Permalink
Merge pull request #127 from andypost/patch-1
Browse files Browse the repository at this point in the history
Add deriver and example of common docs
  • Loading branch information
Chi-teck authored Mar 10, 2024
2 parents b8136b9 + e2bf1fa commit 7fb8abd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions templates/_plugin-manager/attribute/src/Attribute/Example.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ final class {{ class_prefix }} extends AttributeBase {

/**
* Constructs a new {{ class_prefix }} instance.
*
* @param string $id
* The plugin ID. There are some implementation bugs that make the plugin
* available only if the ID follows a specific pattern. It must be either
* identical to group or prefixed with the group. E.g. if the group is "foo"
* the ID must be either "foo" or "foo:bar".
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* (optional) The human-readable name of the plugin.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
* (optional) A brief description of the plugin.
* @param class-string|null $deriver
* (optional) The deriver class.
*/
public function __construct(
public readonly string $id,
public readonly ?TranslatableMarkup $label,
public readonly ?TranslatableMarkup $description = NULL,
public readonly ?string $deriver = NULL,
) {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ final class Bar extends AttributeBase {

/**
* Constructs a new Bar instance.
*
* @param string $id
* The plugin ID. There are some implementation bugs that make the plugin
* available only if the ID follows a specific pattern. It must be either
* identical to group or prefixed with the group. E.g. if the group is "foo"
* the ID must be either "foo" or "foo:bar".
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* (optional) The human-readable name of the plugin.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
* (optional) A brief description of the plugin.
* @param class-string|null $deriver
* (optional) The deriver class.
*/
public function __construct(
public readonly string $id,
public readonly ?TranslatableMarkup $label,
public readonly ?TranslatableMarkup $description = NULL,
public readonly ?string $deriver = NULL,
) {}

}

0 comments on commit 7fb8abd

Please sign in to comment.