Skip to content

Commit 145a159

Browse files
authored
Merge pull request #359 from FriendsOfCake/issue-358
Fix deprecation error on CakePHP 5.3
2 parents 2c93625 + baeffce commit 145a159

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/Controller/Component/SearchComponent.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ public function beforeRender(): void
167167
return;
168168
}
169169

170-
/** @phpstan-ignore method.notFound */
171-
$controller->set('_isSearch', $model->isSearch());
172-
/** @phpstan-ignore method.notFound */
173-
$controller->set('_searchParams', $model->searchParams());
170+
/**
171+
* @var \Search\Model\Behavior\SearchBehavior $searchBehavior
172+
* @phpstan-ignore method.unresolvableReturnType
173+
*/
174+
$searchBehavior = $model->getBehavior('Search');
175+
$controller->set('_isSearch', $searchBehavior->isSearch());
176+
$controller->set('_searchParams', $searchBehavior->searchParams());
174177
}
175178

176179
/**

0 commit comments

Comments
 (0)