-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In PHPStan 1.12.0 with bleeding edge generated annotations @method for tables are reported #353
Comments
Not related to the errors, but maybe instead of interface in methods patchEntity, save, saveOrFail could be the specific entity? |
I agree that
could indeed have the concrete Account entity typehhinted.
But then PHPStan would complain in a few more cases where the current annotations and methods "only" return the As for the I didn't know that you can use this syntax in the annotations for method arguments. |
I didnt knew that either :D I will make issue in bake repo for this useConcreteEntities flag seems reasonable |
But as I said: This means that any result from other methods could be considered "wrong" by static analyzers due to the strict concrete requirement then. I am still not too sure it is a good idea. But I can see why some would find it useful. |
I just released
gets generated now. |
2.5.1...2.5.2 - fixed |
Are you sure the array|string => string was OK for get()?
All over the place. |
But finder as array is depricated This was changed based on this: |
Yeah, but variadic usage seems to still need it, too.
So I guess we need to keep it for now. |
\src\Model\Table\AccountsTable.php:55:Class App\Model\Table\AccountsTable has PHPDoc tag @method for method newEntity() parameter #1 $data with no value type specified in iterable type array.
\src\Model\Table\AccountsTable.php:55:Class App\Model\Table\AccountsTable has PHPDoc tag @method for method newEntity() parameter #2 $options with no value type specified in iterable type array.
This problem is with array type in params and with iterable type in params
@method \App\Model\Entity\Account newEntity(array $data, array $options = [])
This should be updated to this
@method \App\Model\Entity\Account newEntity(array<mixed> $data, array<mixed> $options = [])
@method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Account>|false saveMany(iterable $entities, $options = [])
This should be updated to this
@method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Account>|false saveMany(iterable<mixed> $entities, $options = [])
Or better to
@method \Cake\Datasource\ResultSetInterface<\App\Model\Entity\Account>|false saveMany(iterable<\App\Model\Entity\Account> $entities, $options = [])
PHPStan issue: phpstan/phpstan#11593
Edit more issues found:
@method \App\Model\Entity\Service[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
C:\Workplace\many\many\src\Controller\ServicesController.php:60:PHPDoc tag @method for method App\Controller\ServicesController::paginate() return type contains generic interface Cake\Datasource\ResultSetInterface but does not specify its types: T
The text was updated successfully, but these errors were encountered: