Skip to content

Commit c3a621e

Browse files
committed
removed deprecated stuff
1 parent dc5cc9f commit c3a621e

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
@@ -219,14 +219,9 @@ public function setAuthenticator(IAuthenticator $handler): static
219219
/**
220220
* Returns authentication handler.
221221
*/
222-
final public function getAuthenticator(): ?IAuthenticator
222+
final public function getAuthenticator(): IAuthenticator
223223
{
224-
if (func_num_args()) {
225-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthenticatorIfExists()', E_USER_DEPRECATED);
226-
$throw = func_get_arg(0);
227-
}
228-
229-
if (($throw ?? true) && !$this->authenticator) {
224+
if (!$this->authenticator) {
230225
throw new Nette\InvalidStateException('Authenticator has not been set.');
231226
}
232227

@@ -255,12 +250,6 @@ final public function hasAuthenticator(): bool
255250
*/
256251
public function setExpiration(?string $expire, bool|int|null $clearIdentity = null)
257252
{
258-
259-
if (func_num_args() > 2) {
260-
$clearIdentity = $clearIdentity || func_get_arg(2);
261-
trigger_error(__METHOD__ . '() third parameter is deprecated, use second one: setExpiration($time, true|false)', E_USER_DEPRECATED);
262-
}
263-
264253
$arg = $this->storage instanceof UserStorage
265254
? (bool) $clearIdentity
266255
: ($clearIdentity ? IUserStorage::CLEAR_IDENTITY : 0);
@@ -339,14 +328,9 @@ public function setAuthorizator(Authorizator $handler): static
339328
/**
340329
* Returns current authorization handler.
341330
*/
342-
final public function getAuthorizator(): ?Authorizator
331+
final public function getAuthorizator(): Authorizator
343332
{
344-
if (func_num_args()) {
345-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists()', E_USER_DEPRECATED);
346-
$throw = func_get_arg(0);
347-
}
348-
349-
if (($throw ?? true) && !$this->authorizator) {
333+
if (!$this->authorizator) {
350334
throw new Nette\InvalidStateException('Authorizator has not been set.');
351335
}
352336

0 commit comments

Comments
 (0)