Skip to content

Commit 0e93577

Browse files
committed
removed Nette\SmartObject
1 parent 590b965 commit 0e93577

File tree

7 files changed

+6
-27
lines changed

7 files changed

+6
-27
lines changed

src/Bridges/SecurityHttp/CookieStorage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020
final class CookieStorage implements Nette\Security\UserStorage
2121
{
22-
use Nette\SmartObject;
23-
2422
private const MinLength = 13;
2523

2624
private Http\IRequest $request;

src/Bridges/SecurityHttp/SessionStorage.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
*/
2222
final class SessionStorage implements Nette\Security\UserStorage
2323
{
24-
use Nette\SmartObject;
25-
2624
private string $namespace = '';
2725
private Session $sessionHandler;
2826
private ?SessionSection $sessionSection = null;

src/Bridges/SecurityTracy/UserPanel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*/
1919
class UserPanel implements Tracy\IBarPanel
2020
{
21-
use Nette\SmartObject;
22-
2321
private Nette\Security\User $user;
2422

2523

src/Security/Identity.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace Nette\Security;
1111

12-
use Nette;
13-
1412

1513
/**
1614
* @deprecated use Nette\Security\SimpleIdentity
@@ -20,12 +18,6 @@
2018
*/
2119
class Identity implements IIdentity
2220
{
23-
use Nette\SmartObject {
24-
__get as private parentGet;
25-
__set as private parentSet;
26-
__isset as private parentIsSet;
27-
}
28-
2921
private string|int $id;
3022
private array $roles;
3123
private array $data;
@@ -93,8 +85,8 @@ public function getData(): array
9385
*/
9486
public function __set(string $key, $value): void
9587
{
96-
if ($this->parentIsSet($key)) {
97-
$this->parentSet($key, $value);
88+
if (in_array($key, ['id', 'roles', 'data'], strict: true)) {
89+
$this->{"set$key"}($value);
9890

9991
} else {
10092
$this->data[$key] = $value;
@@ -107,8 +99,9 @@ public function __set(string $key, $value): void
10799
*/
108100
public function &__get(string $key): mixed
109101
{
110-
if ($this->parentIsSet($key)) {
111-
return $this->parentGet($key);
102+
if (in_array($key, ['id', 'roles', 'data'], strict: true)) {
103+
$res = $this->{"get$key"}();
104+
return $res;
112105

113106
} else {
114107
return $this->data[$key];
@@ -118,6 +111,6 @@ public function &__get(string $key): mixed
118111

119112
public function __isset(string $key): bool
120113
{
121-
return isset($this->data[$key]) || $this->parentIsSet($key);
114+
return isset($this->data[$key]) || in_array($key, ['id', 'roles', 'data'], strict: true);
122115
}
123116
}

src/Security/Passwords.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
*/
1818
class Passwords
1919
{
20-
use Nette\SmartObject;
21-
2220
private string $algo;
2321
private array $options;
2422

src/Security/Permission.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020
class Permission implements Authorizator
2121
{
22-
use Nette\SmartObject;
23-
2422
private array $roles = [];
2523
private array $resources = [];
2624

src/Security/SimpleAuthenticator.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@
99

1010
namespace Nette\Security;
1111

12-
use Nette;
13-
1412

1513
/**
1614
* Trivial implementation of Authenticator.
1715
*/
1816
class SimpleAuthenticator implements Authenticator
1917
{
20-
use Nette\SmartObject;
21-
2218
private array $passwords;
2319
private array $roles;
2420
private array $data;

0 commit comments

Comments
 (0)