Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 5095520

Browse files
stevebaumanStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent d0c13b3 commit 5095520

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

src/Auth/DatabaseUserProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function validateCredentials(Authenticatable $model, array $credentials)
108108
*
109109
* @return bool
110110
*/
111-
protected function isFallingBack() : bool
111+
protected function isFallingBack(): bool
112112
{
113113
return Config::get('ldap_auth.login_fallback', false);
114114
}

src/Commands/Console/Import.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function handle()
9292
*
9393
* @return int
9494
*/
95-
public function import(array $users = []) : int
95+
public function import(array $users = []): int
9696
{
9797
$imported = 0;
9898

@@ -164,7 +164,7 @@ public function display(array $users = [])
164164
*
165165
* @return bool
166166
*/
167-
public function isLogging() : bool
167+
public function isLogging(): bool
168168
{
169169
return ! $this->option('no-log');
170170
}
@@ -175,7 +175,7 @@ public function isLogging() : bool
175175
*
176176
* @return bool
177177
*/
178-
public function isDeleting() : bool
178+
public function isDeleting(): bool
179179
{
180180
return $this->option('delete') == 'true';
181181
}
@@ -186,7 +186,7 @@ public function isDeleting() : bool
186186
*
187187
* @return bool
188188
*/
189-
public function isRestoring() : bool
189+
public function isRestoring(): bool
190190
{
191191
return $this->option('restore') == 'true';
192192
}
@@ -198,7 +198,7 @@ public function isRestoring() : bool
198198
*
199199
* @return array
200200
*/
201-
public function getUsers() : array
201+
public function getUsers(): array
202202
{
203203
/** @var \Adldap\Query\Builder $query */
204204
$query = Resolver::query();
@@ -234,7 +234,7 @@ public function getUsers() : array
234234
*
235235
* @return bool
236236
*/
237-
protected function save(User $user, Model $model) : bool
237+
protected function save(User $user, Model $model): bool
238238
{
239239
if ($model->save() && $model->wasRecentlyCreated) {
240240
Event::dispatch(new Imported($user, $model));
@@ -313,7 +313,7 @@ protected function delete(User $user, Model $model)
313313
*
314314
* @return Model
315315
*/
316-
protected function model() : Model
316+
protected function model(): Model
317317
{
318318
if (! $this->model) {
319319
$this->model = $this->option('model') ?? Config::get('ldap_auth.model') ?: $this->determineModel();
@@ -355,7 +355,7 @@ protected function determineModel()
355355
*
356356
* @return bool
357357
*/
358-
protected function isUsingSoftDeletes(Model $model) : bool
358+
protected function isUsingSoftDeletes(Model $model): bool
359359
{
360360
return method_exists($model, 'trashed');
361361
}

src/Commands/SyncPassword.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(Model $model, array $credentials = [])
4141
*
4242
* @return Model
4343
*/
44-
public function handle() : Model
44+
public function handle(): Model
4545
{
4646
if ($this->hasPasswordColumn()) {
4747
$password = $this->canSync() ?
@@ -82,7 +82,7 @@ protected function applyPassword($password)
8282
*
8383
* @return bool
8484
*/
85-
protected function passwordNeedsUpdate($password = null) : bool
85+
protected function passwordNeedsUpdate($password = null): bool
8686
{
8787
$current = $this->currentModelPassword();
8888

@@ -98,7 +98,7 @@ protected function passwordNeedsUpdate($password = null) : bool
9898
*
9999
* @return bool
100100
*/
101-
protected function hasPasswordColumn() : bool
101+
protected function hasPasswordColumn(): bool
102102
{
103103
return ! is_null($this->column());
104104
}
@@ -128,7 +128,7 @@ protected function currentModelPassword()
128128
*
129129
* @return bool
130130
*/
131-
protected function canSync() : bool
131+
protected function canSync(): bool
132132
{
133133
return array_key_exists('password', $this->credentials) && $this->syncing();
134134
}
@@ -138,7 +138,7 @@ protected function canSync() : bool
138138
*
139139
* @return bool
140140
*/
141-
protected function syncing() : bool
141+
protected function syncing(): bool
142142
{
143143
return Config::get('ldap_auth.passwords.sync', false);
144144
}

src/Listeners/BindsLdapUserModel.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function handle($event)
4242
*
4343
* @return bool
4444
*/
45-
protected function isUsingAdldapProvider($guard = null) : bool
45+
protected function isUsingAdldapProvider($guard = null): bool
4646
{
4747
return Auth::guard($guard)->getProvider() instanceof DatabaseUserProvider;
4848
}
@@ -54,7 +54,7 @@ protected function isUsingAdldapProvider($guard = null) : bool
5454
*
5555
* @return bool
5656
*/
57-
protected function canBind(Authenticatable $user) : bool
57+
protected function canBind(Authenticatable $user): bool
5858
{
5959
return array_key_exists(HasLdapUser::class, class_uses_recursive($user)) && is_null($user->ldap);
6060
}

src/Resolvers/ResolverInterface.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,33 @@ public function authenticate(User $user, array $credentials = []);
6767
*
6868
* @return \Adldap\Query\Builder
6969
*/
70-
public function query() : Builder;
70+
public function query(): Builder;
7171

7272
/**
7373
* Retrieves the configured LDAP users username attribute.
7474
*
7575
* @return string
7676
*/
77-
public function getLdapDiscoveryAttribute() : string;
77+
public function getLdapDiscoveryAttribute(): string;
7878

7979
/**
8080
* Retrieves the configured LDAP users authenticatable username attribute.
8181
*
8282
* @return string
8383
*/
84-
public function getLdapAuthAttribute() : string;
84+
public function getLdapAuthAttribute(): string;
8585

8686
/**
8787
* Retrieves the configured database username attribute.
8888
*
8989
* @return string
9090
*/
91-
public function getDatabaseUsernameColumn() : string;
91+
public function getDatabaseUsernameColumn(): string;
9292

9393
/**
9494
* Retrieves the configured database identifier attribute.
9595
*
9696
* @return string
9797
*/
98-
public function getDatabaseIdColumn() : string;
98+
public function getDatabaseIdColumn(): string;
9999
}

src/Resolvers/UserResolver.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function authenticate(User $user, array $credentials = [])
130130
/**
131131
* {@inheritdoc}
132132
*/
133-
public function query() : Builder
133+
public function query(): Builder
134134
{
135135
$query = $this->getLdapAuthProvider()->search()->users();
136136

@@ -151,31 +151,31 @@ public function query() : Builder
151151
/**
152152
* {@inheritdoc}
153153
*/
154-
public function getLdapDiscoveryAttribute() : string
154+
public function getLdapDiscoveryAttribute(): string
155155
{
156156
return Config::get('ldap_auth.identifiers.ldap.locate_users_by', 'userprincipalname');
157157
}
158158

159159
/**
160160
* {@inheritdoc}
161161
*/
162-
public function getLdapAuthAttribute() : string
162+
public function getLdapAuthAttribute(): string
163163
{
164164
return Config::get('ldap_auth.identifiers.ldap.bind_users_by', 'distinguishedname');
165165
}
166166

167167
/**
168168
* {@inheritdoc}
169169
*/
170-
public function getDatabaseUsernameColumn() : string
170+
public function getDatabaseUsernameColumn(): string
171171
{
172172
return Config::get('ldap_auth.identifiers.database.username_column', 'email');
173173
}
174174

175175
/**
176176
* {@inheritdoc}
177177
*/
178-
public function getDatabaseIdColumn() : string
178+
public function getDatabaseIdColumn(): string
179179
{
180180
return Config::get('ldap_auth.identifiers.database.guid_column', 'objectguid');
181181
}
@@ -199,7 +199,7 @@ protected function getPasswordFromCredentials($credentials)
199199
*
200200
* @return ProviderInterface
201201
*/
202-
protected function getLdapAuthProvider() : ProviderInterface
202+
protected function getLdapAuthProvider(): ProviderInterface
203203
{
204204
return $this->ldap->getProvider($this->connection ?? $this->getLdapAuthConnectionName());
205205
}
@@ -209,7 +209,7 @@ protected function getLdapAuthProvider() : ProviderInterface
209209
*
210210
* @return UserProvider
211211
*/
212-
protected function getAppAuthProvider() : UserProvider
212+
protected function getAppAuthProvider(): UserProvider
213213
{
214214
return Auth::guard()->getProvider();
215215
}

0 commit comments

Comments
 (0)