Skip to content

Commit b1b4d27

Browse files
Update yiisoft/auth, fix tests
1 parent cb90015 commit b1b4d27

7 files changed

Lines changed: 13 additions & 12 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"yiisoft/access": "^1.0",
3636
"yiisoft/aliases": "^1.0",
3737
"yiisoft/arrays": "^3.0@dev",
38-
"yiisoft/auth": "^2.0",
38+
"yiisoft/auth": "^3.0",
3939
"yiisoft/cache": "^3.0@dev",
4040
"yiisoft/cache-file": "^3.0@dev",
4141
"yiisoft/composer-config-plugin": "^1.0@dev",

src/Auth/AuthRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ final class AuthRequest extends RequestModel implements ValidatableModelInterfac
2020
{
2121
public function getLogin(): string
2222
{
23-
return (string)$this->getValue('body.login');
23+
return (string)$this->getAttributeValue('body.login');
2424
}
2525

2626
public function getPassword(): string
2727
{
28-
return (string)$this->getValue('body.password');
28+
return (string)$this->getAttributeValue('body.password');
2929
}
3030

3131
public function getRules(): array

src/Blog/EditPostRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ final class EditPostRequest extends RequestModel implements ValidatableModelInte
2323
{
2424
public function getId(): int
2525
{
26-
return (int)$this->getValue('attributes.id');
26+
return (int)$this->getAttributeValue('attributes.id');
2727
}
2828

2929
public function getTitle(): string
3030
{
31-
return (string)$this->getValue('body.title');
31+
return (string)$this->getAttributeValue('body.title');
3232
}
3333

3434
public function getText(): string
3535
{
36-
return (string)$this->getValue('body.text');
36+
return (string)$this->getAttributeValue('body.text');
3737
}
3838

3939
public function getStatus(): PostStatus
4040
{
41-
return new PostStatus($this->getValue('body.status'));
41+
return new PostStatus($this->getAttributeValue('body.status'));
4242
}
4343

4444
public function getRules(): array

src/Blog/PageRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ final class PageRequest extends RequestModel
2424

2525
public function getPage(): int
2626
{
27-
if ($this->hasValue('query.page')) {
28-
return (int)$this->getValue('query.page');
27+
if ($this->hasAttribute('query.page')) {
28+
return (int)$this->getAttributeValue('query.page');
2929
}
3030

3131
return self::DEFAULT_PAGE_PARAM;

src/Blog/ViewPostRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ final class ViewPostRequest extends RequestModel
1010
{
1111
public function getId(): int
1212
{
13-
return (int)$this->getValue('attributes.id');
13+
return (int)$this->getAttributeValue('attributes.id');
1414
}
1515
}

src/User/UserRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
use Cycle\ORM\Select;
99
use Cycle\ORM\Transaction;
1010
use Yiisoft\Auth\IdentityInterface;
11+
use Yiisoft\Auth\IdentityRepositoryInterface;
1112
use Yiisoft\Auth\IdentityWithTokenRepositoryInterface;
1213
use Yiisoft\Data\Reader\Sort;
1314
use Yiisoft\Yii\Cycle\Data\Reader\EntityReader;
1415

15-
final class UserRepository extends Select\Repository implements IdentityWithTokenRepositoryInterface
16+
final class UserRepository extends Select\Repository implements IdentityWithTokenRepositoryInterface, IdentityRepositoryInterface
1617
{
1718
private ORMInterface $orm;
1819

src/User/UserRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public function getUser(): User
1414
/**
1515
* @var User $identity
1616
*/
17-
return $this->getValue('attributes.' . Authentication::class);
17+
return $this->getAttributeValue('attributes.' . Authentication::class);
1818
}
1919
}

0 commit comments

Comments
 (0)