Skip to content

Commit b4b6698

Browse files
committed
removed deprecated stuff
1 parent 690b401 commit b4b6698

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
@@ -223,14 +223,9 @@ public function setAuthenticator(IAuthenticator $handler): static
223223
/**
224224
* Returns authentication handler.
225225
*/
226-
final public function getAuthenticator(): ?IAuthenticator
226+
final public function getAuthenticator(): IAuthenticator
227227
{
228-
if (func_num_args()) {
229-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthenticatorIfExists()', E_USER_DEPRECATED);
230-
$throw = func_get_arg(0);
231-
}
232-
233-
if (($throw ?? true) && !$this->authenticator) {
228+
if (!$this->authenticator) {
234229
throw new Nette\InvalidStateException('Authenticator has not been set.');
235230
}
236231

@@ -259,12 +254,6 @@ final public function hasAuthenticator(): bool
259254
*/
260255
public function setExpiration(?string $expire, bool|int|null $clearIdentity = null)
261256
{
262-
263-
if (func_num_args() > 2) {
264-
$clearIdentity = $clearIdentity || func_get_arg(2);
265-
trigger_error(__METHOD__ . '() third parameter is deprecated, use second one: setExpiration($time, true|false)', E_USER_DEPRECATED);
266-
}
267-
268257
$arg = $this->storage instanceof UserStorage
269258
? (bool) $clearIdentity
270259
: ($clearIdentity ? IUserStorage::CLEAR_IDENTITY : 0);
@@ -343,14 +332,9 @@ public function setAuthorizator(Authorizator $handler): static
343332
/**
344333
* Returns current authorization handler.
345334
*/
346-
final public function getAuthorizator(): ?Authorizator
335+
final public function getAuthorizator(): Authorizator
347336
{
348-
if (func_num_args()) {
349-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists()', E_USER_DEPRECATED);
350-
$throw = func_get_arg(0);
351-
}
352-
353-
if (($throw ?? true) && !$this->authorizator) {
337+
if (!$this->authorizator) {
354338
throw new Nette\InvalidStateException('Authorizator has not been set.');
355339
}
356340

0 commit comments

Comments
 (0)