Skip to content

Commit b98d93b

Browse files
committed
removed deprecated stuff
1 parent cbc8036 commit b98d93b

2 files changed

Lines changed: 5 additions & 23 deletions

File tree

src/Security/SimpleAuthenticator.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,8 @@ public function __construct(array $userlist, array $usersRoles = [], array $user
4444
* and returns IIdentity on success or throws AuthenticationException
4545
* @throws AuthenticationException
4646
*/
47-
public function authenticate(/*string*/ $username, string $password = null): IIdentity
47+
public function authenticate(string $username, string $password = null): IIdentity
4848
{
49-
if (is_array($username)) {
50-
[$username, $password] = $username; // back compatibility
51-
trigger_error(__METHOD__ . '() now accepts arguments (string $username, string $password).', E_USER_DEPRECATED);
52-
}
53-
5449
foreach ($this->userlist as $name => $pass) {
5550
if (strcasecmp($name, $username) === 0) {
5651
if ((string) $pass === (string) $password) {

src/Security/User.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,9 @@ public function setAuthenticator(IAuthenticator $handler): static
220220
/**
221221
* Returns authentication handler.
222222
*/
223-
final public function getAuthenticator(): ?IAuthenticator
223+
final public function getAuthenticator(): IAuthenticator
224224
{
225-
if (func_num_args()) {
226-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthenticatorIfExists()', E_USER_DEPRECATED);
227-
$throw = func_get_arg(0);
228-
}
229-
if (($throw ?? true) && !$this->authenticator) {
225+
if (!$this->authenticator) {
230226
throw new Nette\InvalidStateException('Authenticator has not been set.');
231227
}
232228
return $this->authenticator;
@@ -254,11 +250,6 @@ final public function hasAuthenticator(): bool
254250
*/
255251
public function setExpiration(?string $expire, bool|int $clearIdentity = null)
256252
{
257-
if (func_num_args() > 2) {
258-
$clearIdentity = $clearIdentity || func_get_arg(2);
259-
trigger_error(__METHOD__ . '() third parameter is deprecated, use second one: setExpiration($time, true|false)', E_USER_DEPRECATED);
260-
}
261-
262253
$arg = $this->storage instanceof UserStorage
263254
? (bool) $clearIdentity
264255
: ($clearIdentity ? IUserStorage::CLEAR_IDENTITY : 0);
@@ -336,13 +327,9 @@ public function setAuthorizator(Authorizator $handler): static
336327
/**
337328
* Returns current authorization handler.
338329
*/
339-
final public function getAuthorizator(): ?Authorizator
330+
final public function getAuthorizator(): Authorizator
340331
{
341-
if (func_num_args()) {
342-
trigger_error(__METHOD__ . '() parameter $throw is deprecated, use getAuthorizatorIfExists()', E_USER_DEPRECATED);
343-
$throw = func_get_arg(0);
344-
}
345-
if (($throw ?? true) && !$this->authorizator) {
332+
if (!$this->authorizator) {
346333
throw new Nette\InvalidStateException('Authorizator has not been set.');
347334
}
348335
return $this->authorizator;

0 commit comments

Comments
 (0)