From fd0eb9166ca50b1800480a81943983fa66de7a94 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 8 Jan 2025 22:00:00 +0000 Subject: [PATCH] Add a Phpactor template for creating collections --- phpactor/phpactor.yml | 1 + .../templates/collection/SourceCode.php.twig | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 phpactor/templates/collection/SourceCode.php.twig diff --git a/phpactor/phpactor.yml b/phpactor/phpactor.yml index 536f408..1c755d1 100644 --- a/phpactor/phpactor.yml +++ b/phpactor/phpactor.yml @@ -1,4 +1,5 @@ code_transform.class_new.variants: + collection: collection default: default drupal-functional-test: drupal-functional-test drupal-kernel-test: drupal-kernel-test diff --git a/phpactor/templates/collection/SourceCode.php.twig b/phpactor/templates/collection/SourceCode.php.twig new file mode 100644 index 0000000..15a9731 --- /dev/null +++ b/phpactor/templates/collection/SourceCode.php.twig @@ -0,0 +1,22 @@ +items); + } + + public function toArray(): array { + return $this->items; + } + +} +{% endfor %}