From c0f9477bcf4f32464e08d039196a0784f4fe856b Mon Sep 17 00:00:00 2001 From: Alexander Volle Date: Sun, 25 Jul 2021 22:54:56 +0200 Subject: [PATCH] Add more specific typehinting for add and edit templates --- templates/bake/Template/add.twig | 4 ++-- templates/bake/Template/edit.twig | 4 ++-- tests/comparisons/Template/testBakeEdit.php | 2 +- .../Template/testBakeEditWithBelongsToManyAssociation.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/bake/Template/add.twig b/templates/bake/Template/add.twig index a860a73d..068f8d44 100644 --- a/templates/bake/Template/add.twig +++ b/templates/bake/Template/add.twig @@ -20,13 +20,13 @@ {{- "\n" }} {%- if associations.BelongsTo is defined %} {%- for assocName, assocData in associations.BelongsTo %} - * @var array ${{ assocData.variable }} + * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} {{- "\n" }} {%- endfor %} {% endif %} {%- if associations.BelongsToMany is defined %} {%- for assocName, assocData in associations.BelongsToMany %} - * @var array ${{ assocData.variable }} + * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} {{- "\n" }} {%- endfor %} {% endif %} diff --git a/templates/bake/Template/edit.twig b/templates/bake/Template/edit.twig index a860a73d..c0df18eb 100644 --- a/templates/bake/Template/edit.twig +++ b/templates/bake/Template/edit.twig @@ -20,13 +20,13 @@ {{- "\n" }} {%- if associations.BelongsTo is defined %} {%- for assocName, assocData in associations.BelongsTo %} - * @var array ${{ assocData.variable }} + * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} {{- "\n" }} {%- endfor %} {% endif %} {%- if associations.BelongsToMany is defined %} {%- for assocName, assocData in associations.BelongsToMany %} - * @var array ${{ assocData.variable }} + * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} {{- "\n" }} {%- endfor %} {% endif %} diff --git a/tests/comparisons/Template/testBakeEdit.php b/tests/comparisons/Template/testBakeEdit.php index 6bf6ef4b..04fad9e1 100644 --- a/tests/comparisons/Template/testBakeEdit.php +++ b/tests/comparisons/Template/testBakeEdit.php @@ -2,7 +2,7 @@ /** * @var \Bake\Test\App\View\AppView $this * @var \Cake\Datasource\EntityInterface $author - * @var array $roles + * @var string[]|\Cake\Collection\CollectionInterface $roles */ ?>
diff --git a/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php b/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php index c8f2434d..e3b4a49e 100644 --- a/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php +++ b/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php @@ -2,8 +2,8 @@ /** * @var \Bake\Test\App\View\AppView $this * @var \Cake\Datasource\EntityInterface $article - * @var array $authors - * @var array $tags + * @var string[]|\Cake\Collection\CollectionInterface $authors + * @var string[]|\Cake\Collection\CollectionInterface $tags */ ?>