Skip to content

Commit b87b3e7

Browse files
committed
removed deprecated stuff
1 parent e843379 commit b87b3e7

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

src/Security/User.php

Lines changed: 4 additions & 19 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,11 +257,6 @@ final public function hasAuthenticator(): bool
262257
*/
263258
public function setExpiration(?string $expire, bool|int|null $clearIdentity = null)
264259
{
265-
if (func_num_args() > 2) {
266-
$clearIdentity = $clearIdentity || func_get_arg(2);
267-
trigger_error(__METHOD__ . '() third parameter is deprecated, use second one: setExpiration($time, true|false)', E_USER_DEPRECATED);
268-
}
269-
270260
$arg = $this->storage instanceof UserStorage
271261
? (bool) $clearIdentity
272262
: ($clearIdentity ? IUserStorage::CLEAR_IDENTITY : 0);
@@ -345,14 +335,9 @@ public function setAuthorizator(Authorizator $handler): static
345335
/**
346336
* Returns current authorization handler.
347337
*/
348-
final public function getAuthorizator(): ?Authorizator
338+
final public function getAuthorizator(): Authorizator
349339
{
350-
if (func_num_args()) {
351-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists()', E_USER_DEPRECATED);
352-
$throw = func_get_arg(0);
353-
}
354-
355-
if (($throw ?? true) && !$this->authorizator) {
340+
if (!$this->authorizator) {
356341
throw new Nette\InvalidStateException('Authorizator has not been set.');
357342
}
358343

0 commit comments

Comments
 (0)