Skip to content

Commit e7ba639

Browse files
committed
Presenter: deprecated annotaton @user (BC break)
1 parent 79b2a3b commit e7ba639

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Application/UI/Presenter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,11 @@ protected function shutdown(Application\IResponse $response)
299299
public function checkRequirements($element): void
300300
{
301301
$user = (array) ComponentReflection::parseAnnotation($element, 'User');
302-
if (in_array('loggedIn', $user, true) && !$this->getUser()->isLoggedIn()) {
303-
throw new Application\ForbiddenRequestException;
302+
if (in_array('loggedIn', $user, true)) {
303+
trigger_error(__METHOD__ . '() annotation @User is deprecated', E_USER_DEPRECATED);
304+
if (!$this->getUser()->isLoggedIn()) {
305+
throw new Application\ForbiddenRequestException;
306+
}
304307
}
305308
}
306309

0 commit comments

Comments
 (0)