@@ -42,7 +42,7 @@ class ViewListener extends BaseListener
4242 *
4343 * @param \Cake\Event\EventInterface $event Event.
4444 * @return void
45- * @psalm -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
45+ * @phpstan -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
4646 */
4747 public function beforeFind (EventInterface $ event ): void
4848 {
@@ -63,7 +63,7 @@ public function beforeFind(EventInterface $event): void
6363 *
6464 * @param \Cake\Event\EventInterface $event Event.
6565 * @return void
66- * @psalm -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
66+ * @phpstan -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
6767 */
6868 public function beforePaginate (EventInterface $ event ): void
6969 {
@@ -84,7 +84,7 @@ public function beforePaginate(EventInterface $event): void
8484 *
8585 * @param \Cake\Event\EventInterface $event Event.
8686 * @return void
87- * @psalm -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
87+ * @phpstan -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
8888 */
8989 public function beforeRender (EventInterface $ event ): void
9090 {
@@ -96,7 +96,6 @@ public function beforeRender(EventInterface $event): void
9696 $ this ->_entity = $ event ->getSubject ()->entity ;
9797 }
9898
99- /** @psalm-suppress RedundantPropertyInitializationCheck */
10099 if (!isset ($ this ->associations )) {
101100 $ this ->associations = $ this ->_associations (array_keys ($ this ->_getRelatedModels ()));
102101 }
@@ -134,12 +133,11 @@ public function beforeRender(EventInterface $event): void
134133 *
135134 * @param \Cake\Event\EventInterface $event Event.
136135 * @return void
137- * @psalm -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
136+ * @phpstan -param \Cake\Event\EventInterface<\Crud\Event\Subject> $event
138137 */
139138 public function setFlash (EventInterface $ event ): void
140139 {
141140 unset($ event ->getSubject ()->params ['class ' ]);
142- /** @psalm-suppress UndefinedPropertyAssignment */
143141 $ event ->getSubject ()->element = ltrim ($ event ->getSubject ()->type );
144142 }
145143
@@ -181,11 +179,11 @@ protected function _getPageTitle(): string
181179 $ displayFieldValue === null
182180 || $ this ->_model ()->getDisplayField () === $ this ->_model ()->getPrimaryKey ()
183181 ) {
184- /** @psalm -var string $primaryKeyValue */
182+ /** @phpstan -var string $primaryKeyValue */
185183 return sprintf ('%s %s #%s ' , $ actionName , $ controllerName , $ primaryKeyValue );
186184 }
187185
188- /** @psalm -var string $primaryKeyValue */
186+ /** @phpstan -var string $primaryKeyValue */
189187 return sprintf ('%s %s #%s: %s ' , $ actionName , $ controllerName , $ primaryKeyValue , $ displayFieldValue );
190188 }
191189
@@ -410,9 +408,7 @@ protected function _getControllerActions(): array
410408 }
411409
412410 foreach ($ actionBlacklist as $ actionName ) {
413- /** @psalm-suppress EmptyArrayAccess */
414411 unset($ table [$ actionName ]);
415- /** @psalm-suppress EmptyArrayAccess */
416412 unset($ entity [$ actionName ]);
417413 }
418414
@@ -440,7 +436,6 @@ protected function _getControllerActionConfiguration(string $actionName, array $
440436 if ($ this ->_crud ()->isActionMapped ($ realAction )) {
441437 $ action = $ this ->_action ($ realAction );
442438 $ class = get_class ($ action );
443- /** @psalm-suppress PossiblyFalseOperand */
444439 $ class = substr ($ class , strrpos ($ class , '\\' ) + 1 );
445440
446441 if ($ class === 'DeleteAction ' ) {
@@ -591,7 +586,6 @@ protected function _primaryKeyValue(): array|string|int|null
591586 */
592587 protected function _displayFieldValue (): string |int |null
593588 {
594- /** @psalm-suppress PossiblyInvalidArgument */
595589 return $ this ->_deriveFieldFromContext ($ this ->_model ()->getDisplayField ());
596590 }
597591
0 commit comments