Skip to content

Commit 5cd8321

Browse files
committed
refactor: add return type self
1 parent 1dffd55 commit 5cd8321

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(Authentication $authenticate)
4343
*
4444
* @return $this
4545
*/
46-
public function setAuthenticator(?string $alias = null)
46+
public function setAuthenticator(?string $alias = null): self
4747
{
4848
if (! empty($alias)) {
4949
$this->alias = $alias;

src/Authentication/Authentication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function factory(?string $alias = null): AuthenticatorInterface
6363
*
6464
* @return $this
6565
*/
66-
public function setProvider(UserProvider $provider)
66+
public function setProvider(UserProvider $provider): self
6767
{
6868
$this->userProvider = $provider;
6969

src/Authentication/Authenticators/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(UserProvider $provider)
4848
*
4949
* @return $this
5050
*/
51-
public function remember(bool $shouldRemember = true)
51+
public function remember(bool $shouldRemember = true): self
5252
{
5353
$this->shouldRemember = $shouldRemember;
5454

src/Authentication/Traits/Authenticatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getRememberToken(): ?string
7575
*
7676
* @return $this
7777
*/
78-
public function setRememberToken(string $value)
78+
public function setRememberToken(string $value): self
7979
{
8080
$column = $this->getRememberColumn();
8181

src/Authentication/Traits/HasAccessTokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function currentAccessToken(): ?AccessToken
146146
*
147147
* @return $this
148148
*/
149-
public function setAccessToken(?AccessToken $accessToken)
149+
public function setAccessToken(?AccessToken $accessToken): self
150150
{
151151
$this->attributes['activeAccessToken'] = $accessToken;
152152

src/Authorization/Traits/Authorizable.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait Authorizable
1616
*
1717
* @return $this
1818
*/
19-
public function addGroup(string ...$groups)
19+
public function addGroup(string ...$groups): self
2020
{
2121
$this->populateGroups();
2222
$configGroups = function_exists('setting')
@@ -54,7 +54,7 @@ public function addGroup(string ...$groups)
5454
*
5555
* @return $this
5656
*/
57-
public function removeGroup(string ...$groups)
57+
public function removeGroup(string ...$groups): self
5858
{
5959
$this->populateGroups();
6060

@@ -80,7 +80,7 @@ public function removeGroup(string ...$groups)
8080
*
8181
* @return $this
8282
*/
83-
public function syncGroups(array $groups)
83+
public function syncGroups(array $groups): self
8484
{
8585
$this->populateGroups();
8686
$configGroups = function_exists('setting')
@@ -127,7 +127,7 @@ public function getPermissions(): ?array
127127
*
128128
* @return $this
129129
*/
130-
public function addPermission(string ...$permissions)
130+
public function addPermission(string ...$permissions): self
131131
{
132132
$this->populatePermissions();
133133
$configPermissions = function_exists('setting')
@@ -165,7 +165,7 @@ public function addPermission(string ...$permissions)
165165
*
166166
* @return $this
167167
*/
168-
public function removePermission(string ...$permissions)
168+
public function removePermission(string ...$permissions): self
169169
{
170170
$this->populatePermissions();
171171

@@ -191,7 +191,7 @@ public function removePermission(string ...$permissions)
191191
*
192192
* @return $this
193193
*/
194-
public function syncPermissions(array $permissions)
194+
public function syncPermissions(array $permissions): self
195195
{
196196
$this->populatePermissions();
197197
$configPermissions = function_exists('setting')

src/Interfaces/Authenticatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getRememberToken(): ?string;
4545
*
4646
* @return $this
4747
*/
48-
public function setRememberToken(string $value);
48+
public function setRememberToken(string $value): self;
4949

5050
/**
5151
* Returns the column name that stores the remember-me value.

src/Models/UserModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class UserModel extends Model implements UserProvider
4141
*
4242
* @return $this
4343
*/
44-
public function withIdentities()
44+
public function withIdentities(): self
4545
{
4646
$this->fetchIdentities = true;
4747

src/Test/AuthenticationTesting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait AuthenticationTesting
1717
*
1818
* @return $this
1919
*/
20-
public function actingAs(Authenticatable $user)
20+
public function actingAs(Authenticatable $user): self
2121
{
2222
// Ensure the helper is loaded during tests.
2323
helper('auth');

0 commit comments

Comments
 (0)