From c5efb372c17b6ea2b564e7aa300e363cd2a590a0 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 26 Sep 2026 17:19:52 +0530 Subject: [PATCH] Use "array<>" form instead of "[]" to denote arrays in docblocks Also remove blank lines between groups of annotations as per CS rules --- src/View/Helper/DocBlockHelper.php | 7 +++-- templates/bake/Model/entity.twig | 1 - templates/bake/Template/add.twig | 4 +-- templates/bake/Template/edit.twig | 4 +-- tests/TestCase/Command/PluginCommandTest.php | 2 +- .../Command/SimpleBakeCommandTest.php | 2 +- .../View/Helper/DocBlockHelperTest.php | 29 +++++++++++++++++-- ...iationDetectionCategoriesProductsTable.php | 1 - ...akeAssociationDetectionCategoriesTable.php | 2 -- ...ociationDetectionCategoriesTableSigned.php | 2 -- ...keAssociationDetectionOldProductsTable.php | 1 - ...ciationDetectionOldProductsTableSigned.php | 1 - ...sociationDetectionProductVersionsTable.php | 1 - ...ionDetectionProductVersionsTableSigned.php | 1 - .../Model/testBakeEntityCustomHidden.php | 7 ++--- .../comparisons/Model/testBakeEntityEnum.php | 5 ++-- .../Model/testBakeEntityFieldsDefaults.php | 5 ++-- .../Model/testBakeEntityFieldsWhiteList.php | 5 ++-- .../Model/testBakeEntityFullContext.php | 7 ++--- .../Model/testBakeEntityHidden.php | 7 ++--- .../Model/testBakeEntityNoFields.php | 5 ++-- .../Model/testBakeEntitySimple.php | 7 ++--- .../Model/testBakeEntitySimpleUnchanged.php | 7 ++--- .../Model/testBakeEntityWithPlugin.php | 7 ++--- .../testBakeEntityWithPropertyTypeHints.php | 5 ++-- .../comparisons/Model/testBakeTableConfig.php | 2 -- .../Model/testBakeTableNullableForeignKey.php | 1 - .../Model/testBakeTableValidation.php | 1 - .../Model/testBakeTableWithCounterCache.php | 2 -- .../Model/testBakeTableWithEnum.php | 1 - .../Model/testBakeTableWithPlugin.php | 2 -- .../Model/testBakeUpdateEntity.php | 5 ++-- .../comparisons/Model/testBakeUpdateTable.php | 2 -- .../Model/testBakeUpdateTableNoFile.php | 2 -- .../Model/testBakeWithRulesUnique.php | 2 -- tests/comparisons/Template/testBakeEdit.php | 2 +- ...stBakeEditWithBelongsToManyAssociation.php | 4 +-- 37 files changed, 69 insertions(+), 82 deletions(-) diff --git a/src/View/Helper/DocBlockHelper.php b/src/View/Helper/DocBlockHelper.php index 78d6e71b7..b83eae27d 100644 --- a/src/View/Helper/DocBlockHelper.php +++ b/src/View/Helper/DocBlockHelper.php @@ -21,11 +21,12 @@ class DocBlockHelper extends Helper /** * @var bool Whether to add a blank line between different class annotations */ - protected bool $annotationSpacing = true; + protected bool $annotationSpacing = false; /** * Writes the DocBlock header for a class which includes the property and method declarations. Annotations are - * sorted and grouped by type and value. Groups of annotations are separated by blank lines. + * sorted and grouped by type and value. If enabled via the `$annotationSpacing` setting of this helper, groups of + * annotations are separated by blank lines. * * @param string $className The class this comment block is for. * @param string $classType The type of class (example, Entity) @@ -80,7 +81,7 @@ public function associatedEntityTypeToHintType(string $type, Association $associ $annotationType === Association::MANY_TO_MANY || $annotationType === Association::ONE_TO_MANY ) { - return $type . '[]'; + return 'array<' . $type . '>'; } return $type; diff --git a/templates/bake/Model/entity.twig b/templates/bake/Model/entity.twig index c282602fc..8b3944f0a 100644 --- a/templates/bake/Model/entity.twig +++ b/templates/bake/Model/entity.twig @@ -18,7 +18,6 @@ {% set annotations = DocBlock.propertyHints(propertyHintMap) %} {%- if associationHintMap %} - {%~ set annotations = annotations|merge(['']) %} {%~ set annotations = annotations|merge(DocBlock.propertyHints(associationHintMap)) %} {% endif %} diff --git a/templates/bake/Template/add.twig b/templates/bake/Template/add.twig index bfbfcbada..3db742a37 100644 --- a/templates/bake/Template/add.twig +++ b/templates/bake/Template/add.twig @@ -19,12 +19,12 @@ * @var \{{ entityClass }} ${{ singularVar }} {% if associations.BelongsTo is defined %} {%~ for assocName, assocData in associations.BelongsTo %} - * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} + * @var \Cake\Collection\CollectionInterface|array ${{ assocData.variable }} {%~ endfor %} {% endif %} {% if associations.BelongsToMany is defined %} {%~ for assocName, assocData in associations.BelongsToMany %} - * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} + * @var \Cake\Collection\CollectionInterface|array ${{ assocData.variable }} {%~ endfor %} {% endif %} */ diff --git a/templates/bake/Template/edit.twig b/templates/bake/Template/edit.twig index a7d57e8ff..99af30266 100644 --- a/templates/bake/Template/edit.twig +++ b/templates/bake/Template/edit.twig @@ -19,12 +19,12 @@ * @var \{{ entityClass }} ${{ singularVar }} {% if associations.BelongsTo is defined %} {%~ for assocName, assocData in associations.BelongsTo %} - * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} + * @var array|\Cake\Collection\CollectionInterface ${{ assocData.variable }} {%~ endfor %} {% endif %} {% if associations.BelongsToMany is defined %} {%~ for assocName, assocData in associations.BelongsToMany %} - * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} + * @var array|\Cake\Collection\CollectionInterface ${{ assocData.variable }} {%~ endfor %} {% endif %} */ diff --git a/tests/TestCase/Command/PluginCommandTest.php b/tests/TestCase/Command/PluginCommandTest.php index 8b739587c..86b3c564a 100644 --- a/tests/TestCase/Command/PluginCommandTest.php +++ b/tests/TestCase/Command/PluginCommandTest.php @@ -281,7 +281,7 @@ public function assertPluginContents($pluginName, bool $vendor = false): void /** * Get recursive files list for given path. * - * @return string[] + * @return array */ protected function getFiles(string $path): array { diff --git a/tests/TestCase/Command/SimpleBakeCommandTest.php b/tests/TestCase/Command/SimpleBakeCommandTest.php index fd8adcaa0..3274a7ac8 100644 --- a/tests/TestCase/Command/SimpleBakeCommandTest.php +++ b/tests/TestCase/Command/SimpleBakeCommandTest.php @@ -129,7 +129,7 @@ public function testBakePlugin(): void /** * Provider for subclasses. * - * @return string[][] + * @return array> */ public static function subclassProvider(): array { diff --git a/tests/TestCase/View/Helper/DocBlockHelperTest.php b/tests/TestCase/View/Helper/DocBlockHelperTest.php index 51c01e870..d32a8f8d4 100644 --- a/tests/TestCase/View/Helper/DocBlockHelperTest.php +++ b/tests/TestCase/View/Helper/DocBlockHelperTest.php @@ -28,6 +28,7 @@ use Cake\ORM\Table; use Cake\TestSuite\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use ReflectionProperty; /** * DocBlockHelper Test @@ -72,7 +73,7 @@ protected function tearDown(): void } /** - * Tests the classDescription method including annotation spacing + * Tests the classDescription method * * @return void */ @@ -85,6 +86,28 @@ public function testClassDescription(): void '@foo $bar baz', '@see there', ]; + $classDescription = $this->DocBlockHelper->classDescription($className, $classType, $lines); + $expected = "/**\n * Comments Model\n *\n * Line 1\n * @foo \$bar baz\n * @see there\n */"; + $this::assertSame($expected, $classDescription); + } + + /** + * Tests the classDescription method with annotation spacing enabled + * + * @return void + */ + public function testClassDescriptionAnnotationSpacing(): void + { + $className = 'Comments'; + $classType = 'Model'; + $lines = [ + 'Line 1', + '@foo $bar baz', + '@see there', + ]; + $reflection = new ReflectionProperty($this->DocBlockHelper, 'annotationSpacing'); + $reflection->setValue($this->DocBlockHelper, true); + $classDescription = $this->DocBlockHelper->classDescription($className, $classType, $lines); $expected = "/**\n * Comments Model\n *\n * Line 1\n * @foo \$bar baz\n *\n * @see there\n */"; $this::assertSame($expected, $classDescription); @@ -103,14 +126,14 @@ public function testAssociatedEntityTypeToHintType(): void $type = 'Foo'; $association = new BelongsToMany('Foo', $sourceTable); $assocEntityType = $this->DocBlockHelper->associatedEntityTypeToHintType($type, $association); - $expected = 'Foo[]'; + $expected = 'array'; $this->assertSame($expected, $assocEntityType); // Test with ONE_TO_MANY $type = 'Bar'; $association = new HasMany('Bar', $sourceTable); $assocEntityType = $this->DocBlockHelper->associatedEntityTypeToHintType($type, $association); - $expected = 'Bar[]'; + $expected = 'array'; $this->assertSame($expected, $assocEntityType); // Test with ONE_TO_ONE diff --git a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesProductsTable.php b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesProductsTable.php index c5fff2bf1..a99510219 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesProductsTable.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesProductsTable.php @@ -13,7 +13,6 @@ * * @property \Bake\Test\App\Model\Table\CategoriesTable&\Cake\ORM\Association\BelongsTo $Categories * @property \Bake\Test\App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsTo $Products - * * @method \Bake\Test\App\Model\Entity\CategoriesProduct newEmptyEntity() * @method \Bake\Test\App\Model\Entity\CategoriesProduct newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\CategoriesProduct> newEntities(array $data, array $options = []) diff --git a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTable.php b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTable.php index de31577fb..9c7643323 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTable.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTable.php @@ -12,7 +12,6 @@ * Categories Model * * @property \Bake\Test\App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsToMany $Products - * * @method \Bake\Test\App\Model\Entity\Category newEmptyEntity() * @method \Bake\Test\App\Model\Entity\Category newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\Category> newEntities(array $data, array $options = []) @@ -26,7 +25,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class CategoriesTable extends Table diff --git a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTableSigned.php b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTableSigned.php index de31577fb..9c7643323 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTableSigned.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionCategoriesTableSigned.php @@ -12,7 +12,6 @@ * Categories Model * * @property \Bake\Test\App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsToMany $Products - * * @method \Bake\Test\App\Model\Entity\Category newEmptyEntity() * @method \Bake\Test\App\Model\Entity\Category newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\Category> newEntities(array $data, array $options = []) @@ -26,7 +25,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Category>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Category> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class CategoriesTable extends Table diff --git a/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTable.php b/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTable.php index 9c3535bc1..49a307a59 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTable.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTable.php @@ -24,7 +24,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class OldProductsTable extends Table diff --git a/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTableSigned.php b/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTableSigned.php index 9c3535bc1..49a307a59 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTableSigned.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionOldProductsTableSigned.php @@ -24,7 +24,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\OldProduct>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\OldProduct> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class OldProductsTable extends Table diff --git a/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTable.php b/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTable.php index c67238160..06fc7d062 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTable.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTable.php @@ -12,7 +12,6 @@ * ProductVersions Model * * @property \Bake\Test\App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsTo $Products - * * @method \Bake\Test\App\Model\Entity\ProductVersion newEmptyEntity() * @method \Bake\Test\App\Model\Entity\ProductVersion newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\ProductVersion> newEntities(array $data, array $options = []) diff --git a/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTableSigned.php b/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTableSigned.php index 9e3a4a622..d6728d6d7 100644 --- a/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTableSigned.php +++ b/tests/comparisons/Model/testBakeAssociationDetectionProductVersionsTableSigned.php @@ -12,7 +12,6 @@ * ProductVersions Model * * @property \Bake\Test\App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsTo $Products - * * @method \Bake\Test\App\Model\Entity\ProductVersion newEmptyEntity() * @method \Bake\Test\App\Model\Entity\ProductVersion newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\ProductVersion> newEntities(array $data, array $options = []) diff --git a/tests/comparisons/Model/testBakeEntityCustomHidden.php b/tests/comparisons/Model/testBakeEntityCustomHidden.php index 5620c2afb..f4a99d243 100644 --- a/tests/comparisons/Model/testBakeEntityCustomHidden.php +++ b/tests/comparisons/Model/testBakeEntityCustomHidden.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \Bake\Test\App\Model\Entity\Comment[] $comments - * @property \Bake\Test\App\Model\Entity\Relation[] $relations - * @property \Bake\Test\App\Model\Entity\TodoItem[] $todo_items + * @property array<\Bake\Test\App\Model\Entity\Comment> $comments + * @property array<\Bake\Test\App\Model\Entity\Relation> $relations + * @property array<\Bake\Test\App\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityEnum.php b/tests/comparisons/Model/testBakeEntityEnum.php index c238ee515..f3bb6c1f2 100644 --- a/tests/comparisons/Model/testBakeEntityEnum.php +++ b/tests/comparisons/Model/testBakeEntityEnum.php @@ -13,10 +13,9 @@ * @property string|null $title * @property string|null $body * @property \Bake\Test\App\Model\Enum\ArticleStatus|null $published - * * @property \Bake\Test\App\Model\Entity\Author $author - * @property \Bake\Test\App\Model\Entity\Tag[] $tags - * @property \Bake\Test\App\Model\Entity\ArticlesTag[] $articles_tags + * @property array<\Bake\Test\App\Model\Entity\Tag> $tags + * @property array<\Bake\Test\App\Model\Entity\ArticlesTag> $articles_tags */ class Article extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityFieldsDefaults.php b/tests/comparisons/Model/testBakeEntityFieldsDefaults.php index ce7e18fa3..3a94cf999 100644 --- a/tests/comparisons/Model/testBakeEntityFieldsDefaults.php +++ b/tests/comparisons/Model/testBakeEntityFieldsDefaults.php @@ -17,11 +17,10 @@ * @property int $todo_task_count * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * * @property \Bake\Test\App\Model\Entity\User $user * @property \Bake\Test\App\Model\Entity\TodoReminder $todo_reminder - * @property \Bake\Test\App\Model\Entity\TodoTask[] $todo_tasks - * @property \Bake\Test\App\Model\Entity\TodoLabel[] $todo_labels + * @property array<\Bake\Test\App\Model\Entity\TodoTask> $todo_tasks + * @property array<\Bake\Test\App\Model\Entity\TodoLabel> $todo_labels */ class TodoItem extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityFieldsWhiteList.php b/tests/comparisons/Model/testBakeEntityFieldsWhiteList.php index 7bdd1875d..c45d5965e 100644 --- a/tests/comparisons/Model/testBakeEntityFieldsWhiteList.php +++ b/tests/comparisons/Model/testBakeEntityFieldsWhiteList.php @@ -17,11 +17,10 @@ * @property int $todo_task_count * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * * @property \Bake\Test\App\Model\Entity\User $user * @property \Bake\Test\App\Model\Entity\TodoReminder $todo_reminder - * @property \Bake\Test\App\Model\Entity\TodoTask[] $todo_tasks - * @property \Bake\Test\App\Model\Entity\TodoLabel[] $todo_labels + * @property array<\Bake\Test\App\Model\Entity\TodoTask> $todo_tasks + * @property array<\Bake\Test\App\Model\Entity\TodoLabel> $todo_labels */ class TodoItem extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityFullContext.php b/tests/comparisons/Model/testBakeEntityFullContext.php index 7409ed469..5f2ba7555 100644 --- a/tests/comparisons/Model/testBakeEntityFullContext.php +++ b/tests/comparisons/Model/testBakeEntityFullContext.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \Bake\Test\App\Model\Entity\Comment[] $comments - * @property \Bake\Test\App\Model\Entity\Relation[] $relations - * @property \Bake\Test\App\Model\Entity\TodoItem[] $todo_items + * @property array<\Bake\Test\App\Model\Entity\Comment> $comments + * @property array<\Bake\Test\App\Model\Entity\Relation> $relations + * @property array<\Bake\Test\App\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityHidden.php b/tests/comparisons/Model/testBakeEntityHidden.php index 1bc24a41b..114a63e80 100644 --- a/tests/comparisons/Model/testBakeEntityHidden.php +++ b/tests/comparisons/Model/testBakeEntityHidden.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \Bake\Test\App\Model\Entity\Comment[] $comments - * @property \Bake\Test\App\Model\Entity\Relation[] $relations - * @property \Bake\Test\App\Model\Entity\TodoItem[] $todo_items + * @property array<\Bake\Test\App\Model\Entity\Comment> $comments + * @property array<\Bake\Test\App\Model\Entity\Relation> $relations + * @property array<\Bake\Test\App\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityNoFields.php b/tests/comparisons/Model/testBakeEntityNoFields.php index c0d8ba29c..77309b638 100644 --- a/tests/comparisons/Model/testBakeEntityNoFields.php +++ b/tests/comparisons/Model/testBakeEntityNoFields.php @@ -17,11 +17,10 @@ * @property int $todo_task_count * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * * @property \Bake\Test\App\Model\Entity\User $user * @property \Bake\Test\App\Model\Entity\TodoReminder $todo_reminder - * @property \Bake\Test\App\Model\Entity\TodoTask[] $todo_tasks - * @property \Bake\Test\App\Model\Entity\TodoLabel[] $todo_labels + * @property array<\Bake\Test\App\Model\Entity\TodoTask> $todo_tasks + * @property array<\Bake\Test\App\Model\Entity\TodoLabel> $todo_labels */ class TodoItem extends Entity { diff --git a/tests/comparisons/Model/testBakeEntitySimple.php b/tests/comparisons/Model/testBakeEntitySimple.php index ee2ae4198..819835c67 100644 --- a/tests/comparisons/Model/testBakeEntitySimple.php +++ b/tests/comparisons/Model/testBakeEntitySimple.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \Bake\Test\App\Model\Entity\Comment[] $comments - * @property \Bake\Test\App\Model\Entity\Relation[] $relations - * @property \Bake\Test\App\Model\Entity\TodoItem[] $todo_items + * @property array<\Bake\Test\App\Model\Entity\Comment> $comments + * @property array<\Bake\Test\App\Model\Entity\Relation> $relations + * @property array<\Bake\Test\App\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntitySimpleUnchanged.php b/tests/comparisons/Model/testBakeEntitySimpleUnchanged.php index ee2ae4198..819835c67 100644 --- a/tests/comparisons/Model/testBakeEntitySimpleUnchanged.php +++ b/tests/comparisons/Model/testBakeEntitySimpleUnchanged.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \Bake\Test\App\Model\Entity\Comment[] $comments - * @property \Bake\Test\App\Model\Entity\Relation[] $relations - * @property \Bake\Test\App\Model\Entity\TodoItem[] $todo_items + * @property array<\Bake\Test\App\Model\Entity\Comment> $comments + * @property array<\Bake\Test\App\Model\Entity\Relation> $relations + * @property array<\Bake\Test\App\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityWithPlugin.php b/tests/comparisons/Model/testBakeEntityWithPlugin.php index 298399f7f..103588f6a 100644 --- a/tests/comparisons/Model/testBakeEntityWithPlugin.php +++ b/tests/comparisons/Model/testBakeEntityWithPlugin.php @@ -13,10 +13,9 @@ * @property string|null $password * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * - * @property \BakeTest\Model\Entity\Comment[] $comments - * @property \BakeTest\Model\Entity\Relation[] $relations - * @property \BakeTest\Model\Entity\TodoItem[] $todo_items + * @property array<\BakeTest\Model\Entity\Comment> $comments + * @property array<\BakeTest\Model\Entity\Relation> $relations + * @property array<\BakeTest\Model\Entity\TodoItem> $todo_items */ class User extends Entity { diff --git a/tests/comparisons/Model/testBakeEntityWithPropertyTypeHints.php b/tests/comparisons/Model/testBakeEntityWithPropertyTypeHints.php index 2963b2be3..64d2a0b37 100644 --- a/tests/comparisons/Model/testBakeEntityWithPropertyTypeHints.php +++ b/tests/comparisons/Model/testBakeEntityWithPropertyTypeHints.php @@ -20,11 +20,10 @@ * @property array $array_type * @property array $json_type * @property string $unknown_type - * * @property \Bake\Test\App\Model\Entity\User $user * @property \Bake\Test\App\Model\Entity\TodoReminder $todo_reminder - * @property \BakeTest\Model\Entity\TodoTask[] $todo_tasks - * @property \Bake\Test\App\Model\Entity\TodoLabel[] $todo_labels + * @property array<\BakeTest\Model\Entity\TodoTask> $todo_tasks + * @property array<\Bake\Test\App\Model\Entity\TodoLabel> $todo_labels */ class TodoItem extends Entity { diff --git a/tests/comparisons/Model/testBakeTableConfig.php b/tests/comparisons/Model/testBakeTableConfig.php index 16309d959..a208aebf8 100644 --- a/tests/comparisons/Model/testBakeTableConfig.php +++ b/tests/comparisons/Model/testBakeTableConfig.php @@ -15,7 +15,6 @@ * @property \Bake\Test\App\Model\Table\TodoRemindersTable&\Cake\ORM\Association\HasOne $TodoReminders * @property \Bake\Test\App\Model\Table\TodoTasksTable&\Cake\ORM\Association\HasMany $TodoTasks * @property \Bake\Test\App\Model\Table\TodoLabelsTable&\Cake\ORM\Association\BelongsToMany $TodoLabels - * * @method \Bake\Test\App\Model\Entity\Item newEmptyEntity() * @method \Bake\Test\App\Model\Entity\Item newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\Item> newEntities(array $data, array $options = []) @@ -29,7 +28,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\Item>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Item> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Item>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Item>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\Item>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\Item> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class ItemsTable extends Table diff --git a/tests/comparisons/Model/testBakeTableNullableForeignKey.php b/tests/comparisons/Model/testBakeTableNullableForeignKey.php index fb344af0d..ede629ec7 100644 --- a/tests/comparisons/Model/testBakeTableNullableForeignKey.php +++ b/tests/comparisons/Model/testBakeTableNullableForeignKey.php @@ -24,7 +24,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TestBakeArticlesTable extends Table diff --git a/tests/comparisons/Model/testBakeTableValidation.php b/tests/comparisons/Model/testBakeTableValidation.php index fb344af0d..ede629ec7 100644 --- a/tests/comparisons/Model/testBakeTableValidation.php +++ b/tests/comparisons/Model/testBakeTableValidation.php @@ -24,7 +24,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TestBakeArticlesTable extends Table diff --git a/tests/comparisons/Model/testBakeTableWithCounterCache.php b/tests/comparisons/Model/testBakeTableWithCounterCache.php index 7e5369e00..c0f0d4ad0 100644 --- a/tests/comparisons/Model/testBakeTableWithCounterCache.php +++ b/tests/comparisons/Model/testBakeTableWithCounterCache.php @@ -12,7 +12,6 @@ * TodoTasks Model * * @property \Bake\Test\App\Model\Table\TodoItemsTable&\Cake\ORM\Association\BelongsTo $TodoItems - * * @method \Bake\Test\App\Model\Entity\TodoTask newEmptyEntity() * @method \Bake\Test\App\Model\Entity\TodoTask newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\TodoTask> newEntities(array $data, array $options = []) @@ -26,7 +25,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TodoTask>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoTask> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoTask>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoTask>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoTask>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoTask> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior * @mixin \Cake\ORM\Behavior\CounterCacheBehavior */ diff --git a/tests/comparisons/Model/testBakeTableWithEnum.php b/tests/comparisons/Model/testBakeTableWithEnum.php index 07a54bbbc..06f8ad287 100644 --- a/tests/comparisons/Model/testBakeTableWithEnum.php +++ b/tests/comparisons/Model/testBakeTableWithEnum.php @@ -24,7 +24,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TestBakeArticle>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TestBakeArticle> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TestBakeArticlesTable extends Table diff --git a/tests/comparisons/Model/testBakeTableWithPlugin.php b/tests/comparisons/Model/testBakeTableWithPlugin.php index a47976633..4b7224c9c 100644 --- a/tests/comparisons/Model/testBakeTableWithPlugin.php +++ b/tests/comparisons/Model/testBakeTableWithPlugin.php @@ -14,7 +14,6 @@ * @property \BakeTest\Model\Table\CommentsTable&\Cake\ORM\Association\HasMany $Comments * @property \BakeTest\Model\Table\RelationsTable&\Cake\ORM\Association\HasMany $Relations * @property \BakeTest\Model\Table\TodoItemsTable&\Cake\ORM\Association\HasMany $TodoItems - * * @method \BakeTest\Model\Entity\User newEmptyEntity() * @method \BakeTest\Model\Entity\User newEntity(array $data, array $options = []) * @method array<\BakeTest\Model\Entity\User> newEntities(array $data, array $options = []) @@ -28,7 +27,6 @@ * @method iterable<\BakeTest\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\BakeTest\Model\Entity\User> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\BakeTest\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\BakeTest\Model\Entity\User>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\BakeTest\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\BakeTest\Model\Entity\User> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class UsersTable extends Table diff --git a/tests/comparisons/Model/testBakeUpdateEntity.php b/tests/comparisons/Model/testBakeUpdateEntity.php index 940bac049..555ef70bd 100644 --- a/tests/comparisons/Model/testBakeUpdateEntity.php +++ b/tests/comparisons/Model/testBakeUpdateEntity.php @@ -19,11 +19,10 @@ * @property int $todo_task_count * @property \Cake\I18n\DateTime|null $created * @property \Cake\I18n\DateTime|null $updated - * * @property \Bake\Test\App\Model\Entity\User $user * @property \Bake\Test\App\Model\Entity\TodoReminder $todo_reminder - * @property \Bake\Test\App\Model\Entity\TodoTask[] $todo_tasks - * @property \Bake\Test\App\Model\Entity\TodoLabel[] $todo_labels + * @property array<\Bake\Test\App\Model\Entity\TodoTask> $todo_tasks + * @property array<\Bake\Test\App\Model\Entity\TodoLabel> $todo_labels */ class TodoItem extends Entity implements IdentityInterface { diff --git a/tests/comparisons/Model/testBakeUpdateTable.php b/tests/comparisons/Model/testBakeUpdateTable.php index 864394da0..34500b426 100644 --- a/tests/comparisons/Model/testBakeUpdateTable.php +++ b/tests/comparisons/Model/testBakeUpdateTable.php @@ -17,7 +17,6 @@ * @property \Bake\Test\App\Model\Table\TodoRemindersTable&\Cake\ORM\Association\HasOne $TodoReminders * @property \Bake\Test\App\Model\Table\TodoTasksTable&\Cake\ORM\Association\HasMany $TodoTasks * @property \Bake\Test\App\Model\Table\TodoLabelsTable&\Cake\ORM\Association\BelongsToMany $TodoLabels - * * @method \Bake\Test\App\Model\Entity\TodoItem newEmptyEntity() * @method \Bake\Test\App\Model\Entity\TodoItem newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\TodoItem> newEntities(array $data, array $options = []) @@ -31,7 +30,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TodoItemsTable extends Table implements SomeInterface diff --git a/tests/comparisons/Model/testBakeUpdateTableNoFile.php b/tests/comparisons/Model/testBakeUpdateTableNoFile.php index 0d2626385..0b7f21cff 100644 --- a/tests/comparisons/Model/testBakeUpdateTableNoFile.php +++ b/tests/comparisons/Model/testBakeUpdateTableNoFile.php @@ -15,7 +15,6 @@ * @property \Bake\Test\App\Model\Table\TodoRemindersTable&\Cake\ORM\Association\HasOne $TodoReminders * @property \Bake\Test\App\Model\Table\TodoTasksTable&\Cake\ORM\Association\HasMany $TodoTasks * @property \Bake\Test\App\Model\Table\TodoLabelsTable&\Cake\ORM\Association\BelongsToMany $TodoLabels - * * @method \Bake\Test\App\Model\Entity\TodoItem newEmptyEntity() * @method \Bake\Test\App\Model\Entity\TodoItem newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\TodoItem> newEntities(array $data, array $options = []) @@ -29,7 +28,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\TodoItem>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\TodoItem> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class TodoItemsTable extends Table diff --git a/tests/comparisons/Model/testBakeWithRulesUnique.php b/tests/comparisons/Model/testBakeWithRulesUnique.php index 1c4e92eb5..97927e120 100644 --- a/tests/comparisons/Model/testBakeWithRulesUnique.php +++ b/tests/comparisons/Model/testBakeWithRulesUnique.php @@ -14,7 +14,6 @@ * @property \Bake\Test\App\Model\Table\CommentsTable&\Cake\ORM\Association\HasMany $Comments * @property \Bake\Test\App\Model\Table\RelationsTable&\Cake\ORM\Association\HasMany $Relations * @property \Bake\Test\App\Model\Table\TodoItemsTable&\Cake\ORM\Association\HasMany $TodoItems - * * @method \Bake\Test\App\Model\Entity\User newEmptyEntity() * @method \Bake\Test\App\Model\Entity\User newEntity(array $data, array $options = []) * @method array<\Bake\Test\App\Model\Entity\User> newEntities(array $data, array $options = []) @@ -28,7 +27,6 @@ * @method iterable<\Bake\Test\App\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\User> saveManyOrFail(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\User>|false deleteMany(iterable $entities, array $options = []) * @method iterable<\Bake\Test\App\Model\Entity\User>|\Cake\Datasource\ResultSetInterface<\Bake\Test\App\Model\Entity\User> deleteManyOrFail(iterable $entities, array $options = []) - * * @mixin \Cake\ORM\Behavior\TimestampBehavior */ class UsersTable extends Table diff --git a/tests/comparisons/Template/testBakeEdit.php b/tests/comparisons/Template/testBakeEdit.php index 5e5df2bf1..2d90b02de 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 string[]|\Cake\Collection\CollectionInterface $roles + * @var array|\Cake\Collection\CollectionInterface $roles */ ?>
diff --git a/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php b/tests/comparisons/Template/testBakeEditWithBelongsToManyAssociation.php index 4c73b7468..0431ad0df 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 string[]|\Cake\Collection\CollectionInterface $authors - * @var string[]|\Cake\Collection\CollectionInterface $tags + * @var array|\Cake\Collection\CollectionInterface $authors + * @var array|\Cake\Collection\CollectionInterface $tags */ ?>