Skip to content

Commit e32718c

Browse files
committed
removed deprecated stuff
1 parent 8d0ea68 commit e32718c

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/Security/User.php

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,9 @@ public function setAuthenticator(IAuthenticator $handler): static
226226
/**
227227
* Returns authentication handler.
228228
*/
229-
final public function getAuthenticator(): ?IAuthenticator
229+
final public function getAuthenticator(): IAuthenticator
230230
{
231-
if (func_num_args()) {
232-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthenticatorIfExists()', E_USER_DEPRECATED);
233-
$throw = func_get_arg(0);
234-
}
235-
236-
if (($throw ?? true) && !$this->authenticator) {
231+
if (!$this->authenticator) {
237232
throw new Nette\InvalidStateException('Authenticator has not been set.');
238233
}
239234

@@ -262,12 +257,6 @@ final public function hasAuthenticator(): bool
262257
*/
263258
public function setExpiration(?string $expire, bool|int|null $clearIdentity = null)
264259
{
265-
266-
if (func_num_args() > 2) {
267-
$clearIdentity = $clearIdentity || func_get_arg(2);
268-
trigger_error(__METHOD__ . '() third parameter is deprecated, use second one: setExpiration($time, true|false)', E_USER_DEPRECATED);
269-
}
270-
271260
$arg = $this->storage instanceof UserStorage
272261
? (bool) $clearIdentity
273262
: ($clearIdentity ? IUserStorage::CLEAR_IDENTITY : 0);
@@ -346,14 +335,9 @@ public function setAuthorizator(Authorizator $handler): static
346335
/**
347336
* Returns current authorization handler.
348337
*/
349-
final public function getAuthorizator(): ?Authorizator
338+
final public function getAuthorizator(): Authorizator
350339
{
351-
if (func_num_args()) {
352-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists()', E_USER_DEPRECATED);
353-
$throw = func_get_arg(0);
354-
}
355-
356-
if (($throw ?? true) && !$this->authorizator) {
340+
if (!$this->authorizator) {
357341
throw new Nette\InvalidStateException('Authorizator has not been set.');
358342
}
359343

0 commit comments

Comments
 (0)