Conversation
Does this need cakedc phpstan extension to understand it? |
|
Probably won't work since it does not use the alias 'Search.Search' |
|
Well, thats not ideal now.. We need to find a way to make this a bit easier to work with. |
|
Here is another annotation. /**
* @var Table<array{Search: SearchBehavior}> $model
*/
var_dump($model->getBehavior('Search')->isSearch());/**
* @var Table<array{
* Search: SearchBehavior,
* Trashable: TrashableBehavior
* }> $model
*/
var_dump($model->getBehavior('Trashable')->findTrashed());
var_dump($model->getBehavior('Search')->isSearch());PHPStan test https://phpstan.org/r/8b468e40-607f-4e85-898f-42effe66fd19 PS: It will NOT require the annotation for $searchBehavior |
|
Ideally we shouldnt need inline annotations, maybe for Cake5.3? :) |
|
It's hard to avoid annotation when methods use keys instead of real class name |
Closes #358