From 00fa6c1eda3d097c89a560d4491364a5c5bcfdf8 Mon Sep 17 00:00:00 2001 From: mscherer Date: Thu, 28 Jul 2022 10:59:25 +0200 Subject: [PATCH] Fix up generic docblocks. --- src/Datasource/RepositoryInterface.php | 2 +- src/ORM/LazyEagerLoader.php | 4 ++-- src/ORM/Table.php | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Datasource/RepositoryInterface.php b/src/Datasource/RepositoryInterface.php index df4ed7d6cdd..93a00416c29 100644 --- a/src/Datasource/RepositoryInterface.php +++ b/src/Datasource/RepositoryInterface.php @@ -242,7 +242,7 @@ public function patchEntity(EntityInterface $entity, array $data, array $options * $article = $this->Articles->patchEntities($articles, $this->request->getData()); * ``` * - * @param \Traversable|array<\Cake\Datasource\EntityInterface> $entities the entities that will get the + * @param iterable<\Cake\Datasource\EntityInterface> $entities the entities that will get the * data merged in * @param array $data list of arrays to be merged into the entities * @param array $options A list of options for the objects hydration. diff --git a/src/ORM/LazyEagerLoader.php b/src/ORM/LazyEagerLoader.php index 2fd6cb9e269..0e7a0103d7e 100644 --- a/src/ORM/LazyEagerLoader.php +++ b/src/ORM/LazyEagerLoader.php @@ -135,11 +135,11 @@ protected function _getPropertyMap(Table $source, array $associations): array * Injects the results of the eager loader query into the original list of * entities. * - * @param \Traversable|array<\Cake\Datasource\EntityInterface> $objects The original list of entities + * @param iterable<\Cake\Datasource\EntityInterface> $objects The original list of entities * @param \Cake\ORM\Query $results The loaded results * @param array $associations The top level associations that were loaded * @param \Cake\ORM\Table $source The table where the entities came from - * @return array + * @return array<\Cake\Datasource\EntityInterface> */ protected function _injectResults(iterable $objects, $results, array $associations, Table $source): array { diff --git a/src/ORM/Table.php b/src/ORM/Table.php index 6f6144878b1..e96d56b0b13 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -2178,9 +2178,9 @@ protected function _update(EntityInterface $entity, array $data) * any one of the records fails to save due to failed validation or database * error. * - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to save. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to save. * @param \Cake\ORM\SaveOptionsBuilder|\ArrayAccess|array $options Options used when calling Table::save() for each entity. - * @return \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface>|false False on failure, entities list on success. + * @return iterable<\Cake\Datasource\EntityInterface>|false False on failure, entities list on success. * @throws \Exception */ public function saveMany(iterable $entities, $options = []) @@ -2199,9 +2199,9 @@ public function saveMany(iterable $entities, $options = []) * any one of the records fails to save due to failed validation or database * error. * - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to save. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to save. * @param \ArrayAccess|array $options Options used when calling Table::save() for each entity. - * @return \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> Entities list. + * @return iterable<\Cake\Datasource\EntityInterface> Entities list. * @throws \Exception * @throws \Cake\ORM\Exception\PersistenceFailedException If an entity couldn't be saved. */ @@ -2211,11 +2211,11 @@ public function saveManyOrFail(iterable $entities, $options = []): iterable } /** - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to save. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to save. * @param \Cake\ORM\SaveOptionsBuilder|\ArrayAccess|array $options Options used when calling Table::save() for each entity. * @throws \Cake\ORM\Exception\PersistenceFailedException If an entity couldn't be saved. * @throws \Exception If an entity couldn't be saved. - * @return \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> Entities list. + * @return iterable<\Cake\Datasource\EntityInterface> Entities list. */ protected function _saveMany(iterable $entities, $options = []): iterable { @@ -2359,9 +2359,9 @@ public function delete(EntityInterface $entity, $options = []): bool * any one of the records fails to delete due to failed validation or database * error. * - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to delete. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to delete. * @param \ArrayAccess|array $options Options used when calling Table::save() for each entity. - * @return \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface>|false Entities list + * @return iterable<\Cake\Datasource\EntityInterface>|false Entities list * on success, false on failure. * @see \Cake\ORM\Table::delete() for options and events related to this method. */ @@ -2383,9 +2383,9 @@ public function deleteMany(iterable $entities, $options = []) * any one of the records fails to delete due to failed validation or database * error. * - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to delete. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to delete. * @param \ArrayAccess|array $options Options used when calling Table::save() for each entity. - * @return \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> Entities list. + * @return iterable<\Cake\Datasource\EntityInterface> Entities list. * @throws \Cake\ORM\Exception\PersistenceFailedException * @see \Cake\ORM\Table::delete() for options and events related to this method. */ @@ -2401,7 +2401,7 @@ public function deleteManyOrFail(iterable $entities, $options = []): iterable } /** - * @param \Cake\Datasource\ResultSetInterface|array<\Cake\Datasource\EntityInterface> $entities Entities to delete. + * @param iterable<\Cake\Datasource\EntityInterface> $entities Entities to delete. * @param \ArrayAccess|array $options Options used. * @return \Cake\Datasource\EntityInterface|null */ @@ -2903,7 +2903,7 @@ public function patchEntity(EntityInterface $entity, array $data, array $options * You can use the `Model.beforeMarshal` event to modify request data * before it is converted into entities. * - * @param \Traversable|array<\Cake\Datasource\EntityInterface> $entities the entities that will get the + * @param iterable<\Cake\Datasource\EntityInterface> $entities the entities that will get the * data merged in * @param array $data list of arrays to be merged into the entities * @param array $options A list of options for the objects hydration.