diff --git a/docs/Annotations.md b/docs/Annotations.md index 9c062b67..f06f9a88 100644 --- a/docs/Annotations.md +++ b/docs/Annotations.md @@ -72,19 +72,19 @@ Tables should annotate their entity related methods, their relations and behavio A LocationsTable class would then get the following doc block annotations added if not already present: ```php /** - * @method \App\Model\Entity\Location get($primaryKey, mixed[] $options = []) + * @method \App\Model\Entity\Location get($primaryKey, array $options = []) * @method \App\Model\Entity\Location newEmptyEntity() - * @method \App\Model\Entity\Location newEntity(mixed[] $data, mixed[] $options = []) - * @method array<\App\Model\Entity\Location> newEntities(mixed[] $data, mixed[] $options = []) - * @method \App\Model\Entity\Location|false save(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \App\Model\Entity\Location saveOrFail(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \App\Model\Entity\Location patchEntity(\Cake\Datasource\EntityInterface $entity, mixed[] $data, mixed[] $options = []) - * @method array<\App\Model\Entity\Location> patchEntities(iterable $entities, mixed[] $data, mixed[] $options = []) - * @method \App\Model\Entity\Location findOrCreate($search, ?callable $callback = null, mixed[] $options = []) - * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location>|false saveMany(iterable $entities, mixed[] $options = []) - * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location> saveManyOrFail(iterable $entities, mixed[] $options = []) - * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location>|false deleteMany(iterable $entities, mixed[] $options = []) - * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location> deleteManyOrFail(iterable $entities, mixed[] $options = []) + * @method \App\Model\Entity\Location newEntity(array $data, array $options = []) + * @method array<\App\Model\Entity\Location> newEntities(array $data, array $options = []) + * @method \App\Model\Entity\Location|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \App\Model\Entity\Location saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \App\Model\Entity\Location patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) + * @method array<\App\Model\Entity\Location> patchEntities(iterable $entities, array $data, array $options = []) + * @method \App\Model\Entity\Location findOrCreate($search, ?callable $callback = null, array $options = []) + * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location>|false saveMany(iterable $entities, array $options = []) + * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location> saveManyOrFail(iterable $entities, array $options = []) + * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location>|false deleteMany(iterable $entities, array $options = []) + * @method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Location> deleteManyOrFail(iterable $entities, array $options = []) * * @property \Cake\ORM\Association\HasMany<\App\Model\Table\ImagesTable> $Images * @property \Cake\ORM\Association\BelongsTo<\App\Model\Table\UsersTable> $Users diff --git a/src/Annotator/ModelAnnotator.php b/src/Annotator/ModelAnnotator.php index 83254115..5ce57008 100644 --- a/src/Annotator/ModelAnnotator.php +++ b/src/Annotator/ModelAnnotator.php @@ -153,8 +153,8 @@ protected function buildAnnotations(array $associations, string $entity, array $ $entityInterface = $fullClassName; } - $dataType = 'mixed[]'; - $optionsType = 'mixed[]'; + $dataType = 'array'; + $optionsType = 'array'; $itterable = 'iterable'; if (Configure::read('IdeHelper.genericsInParam')) { $dataType = 'array'; diff --git a/src/View/Helper/DocBlockHelper.php b/src/View/Helper/DocBlockHelper.php index f4f9145d..7bd9795d 100644 --- a/src/View/Helper/DocBlockHelper.php +++ b/src/View/Helper/DocBlockHelper.php @@ -159,8 +159,8 @@ public function buildTableAnnotations( $classInterface = $class; } - $dataType = 'mixed[]'; - $optionsType = 'mixed[]'; + $dataType = 'array'; + $optionsType = 'array'; $itterable = 'iterable'; if (Configure::read('IdeHelper.genericsInParam')) { $dataType = 'array'; diff --git a/tests/test_files/Model/Table/BarBarsAbstractTable.php b/tests/test_files/Model/Table/BarBarsAbstractTable.php index 6fb0336f..1306b476 100644 --- a/tests/test_files/Model/Table/BarBarsAbstractTable.php +++ b/tests/test_files/Model/Table/BarBarsAbstractTable.php @@ -6,18 +6,18 @@ * @property \Cake\ORM\Association\BelongsToMany<\Awesome\Model\Table\HousesTable> $Houses * * @method \TestApp\Model\Entity\BarBarsAbstract newEmptyEntity() - * @method \TestApp\Model\Entity\BarBarsAbstract newEntity(mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[] newEntities(mixed[] $data, mixed[] $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract newEntity(array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[] newEntities(array $data, array $options = []) * @method \TestApp\Model\Entity\BarBarsAbstract get(mixed $primaryKey, string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args) - * @method \TestApp\Model\Entity\BarBarsAbstract findOrCreate($search, ?callable $callback = null, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract patchEntity(\Cake\Datasource\EntityInterface $entity, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[] patchEntities(iterable $entities, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract|false save(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract saveOrFail(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract>|false saveMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract> saveManyOrFail(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract>|false deleteMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract> deleteManyOrFail(iterable $entities, mixed[] $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract findOrCreate($search, ?callable $callback = null, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[] patchEntities(iterable $entities, array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract>|false saveMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract> saveManyOrFail(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract>|false deleteMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBarsAbstract[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBarsAbstract> deleteManyOrFail(iterable $entities, array $options = []) * * @mixin \Cake\ORM\Behavior\TimestampBehavior * @mixin \MyNamespace\MyPlugin\Model\Behavior\MyBehavior diff --git a/tests/test_files/Model/Table/BarBarsTable.php b/tests/test_files/Model/Table/BarBarsTable.php index f4468e17..1475aecc 100644 --- a/tests/test_files/Model/Table/BarBarsTable.php +++ b/tests/test_files/Model/Table/BarBarsTable.php @@ -8,18 +8,18 @@ * @property \Cake\ORM\Association\BelongsToMany<\Awesome\Model\Table\HousesTable> $Houses * * @method \TestApp\Model\Entity\BarBar newEmptyEntity() - * @method \TestApp\Model\Entity\BarBar newEntity(mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[] newEntities(mixed[] $data, mixed[] $options = []) + * @method \TestApp\Model\Entity\BarBar newEntity(array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBar[] newEntities(array $data, array $options = []) * @method \TestApp\Model\Entity\BarBar get(mixed $primaryKey, string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args) - * @method \TestApp\Model\Entity\BarBar findOrCreate($search, ?callable $callback = null, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar patchEntity(\Cake\Datasource\EntityInterface $entity, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[] patchEntities(iterable $entities, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar|false save(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar saveOrFail(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar>|false saveMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar> saveManyOrFail(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar>|false deleteMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar> deleteManyOrFail(iterable $entities, mixed[] $options = []) + * @method \TestApp\Model\Entity\BarBar findOrCreate($search, ?callable $callback = null, array $options = []) + * @method \TestApp\Model\Entity\BarBar patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBar[] patchEntities(iterable $entities, array $data, array $options = []) + * @method \TestApp\Model\Entity\BarBar|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\BarBar saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar>|false saveMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar> saveManyOrFail(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar>|false deleteMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\BarBar[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\BarBar> deleteManyOrFail(iterable $entities, array $options = []) * * @mixin \Cake\ORM\Behavior\TimestampBehavior * @mixin \MyNamespace\MyPlugin\Model\Behavior\MyBehavior diff --git a/tests/test_files/Model/Table/WheelsTable.php b/tests/test_files/Model/Table/WheelsTable.php index 9bf997c9..d13071e4 100644 --- a/tests/test_files/Model/Table/WheelsTable.php +++ b/tests/test_files/Model/Table/WheelsTable.php @@ -4,20 +4,20 @@ use Cake\ORM\Table; /** - * @method \TestApp\Model\Entity\Wheel newEntity(mixed[] $data, mixed[] $options = []) + * @method \TestApp\Model\Entity\Wheel newEntity(array $data, array $options = []) * @property \Cake\ORM\Association\BelongsTo<\TestApp\Model\Table\CarsTable> $Cars * @method \TestApp\Model\Entity\Wheel newEmptyEntity() - * @method \TestApp\Model\Entity\Wheel[] newEntities(mixed[] $data, mixed[] $options = []) + * @method \TestApp\Model\Entity\Wheel[] newEntities(array $data, array $options = []) * @method \TestApp\Model\Entity\Wheel get(mixed $primaryKey, string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args) - * @method \TestApp\Model\Entity\Wheel findOrCreate($search, ?callable $callback = null, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel patchEntity(\Cake\Datasource\EntityInterface $entity, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel[] patchEntities(iterable $entities, mixed[] $data, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel|false save(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel saveOrFail(\Cake\Datasource\EntityInterface $entity, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel>|false saveMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel> saveManyOrFail(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel>|false deleteMany(iterable $entities, mixed[] $options = []) - * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel> deleteManyOrFail(iterable $entities, mixed[] $options = []) + * @method \TestApp\Model\Entity\Wheel findOrCreate($search, ?callable $callback = null, array $options = []) + * @method \TestApp\Model\Entity\Wheel patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = []) + * @method \TestApp\Model\Entity\Wheel[] patchEntities(iterable $entities, array $data, array $options = []) + * @method \TestApp\Model\Entity\Wheel|false save(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\Wheel saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = []) + * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel>|false saveMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel> saveManyOrFail(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel>|false deleteMany(iterable $entities, array $options = []) + * @method \TestApp\Model\Entity\Wheel[]|\Cake\Datasource\ResultSetInterface<\TestApp\Model\Entity\Wheel> deleteManyOrFail(iterable $entities, array $options = []) * @mixin \Cake\ORM\Behavior\TreeBehavior */ class WheelsTable extends Table {