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

Commit aaaadf3

Browse files
authored
Merge pull request #739 from Adldap2/analysis-8mxW5D
Apply fixes from StyleCI
2 parents 0fa1791 + 6aa1100 commit aaaadf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+175
-175
lines changed

src/AdldapAuthServiceProvider.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
namespace Adldap\Laravel;
44

5+
use RuntimeException;
56
use Adldap\AdldapInterface;
6-
use Adldap\Laravel\Auth\DatabaseUserProvider;
7-
use Adldap\Laravel\Commands\Console\Import;
8-
use Adldap\Laravel\Resolvers\ResolverInterface;
9-
use Adldap\Laravel\Resolvers\UserResolver;
10-
use Illuminate\Auth\Events\Authenticated;
117
use Illuminate\Auth\Events\Login;
12-
use Illuminate\Contracts\Hashing\Hasher;
138
use Illuminate\Support\Facades\Auth;
14-
use Illuminate\Support\Facades\Config;
159
use Illuminate\Support\Facades\Event;
10+
use Illuminate\Support\Facades\Config;
1611
use Illuminate\Support\ServiceProvider;
17-
use RuntimeException;
12+
use Illuminate\Contracts\Hashing\Hasher;
13+
use Illuminate\Auth\Events\Authenticated;
14+
use Adldap\Laravel\Resolvers\UserResolver;
15+
use Adldap\Laravel\Commands\Console\Import;
16+
use Adldap\Laravel\Auth\DatabaseUserProvider;
17+
use Adldap\Laravel\Resolvers\ResolverInterface;
1818

1919
class AdldapAuthServiceProvider extends ServiceProvider
2020
{
@@ -92,7 +92,7 @@ protected function makeUserProvider(Hasher $hasher, array $config)
9292
// otherwise we will try to use the providers config array.
9393
$model = Config::get('ldap_auth.model') ?? array_get($config, 'model');
9494

95-
if (!$model) {
95+
if (! $model) {
9696
throw new RuntimeException(
9797
"No model is configured. You must configure a model to use with the {$provider}."
9898
);

src/AdldapServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use Adldap\Adldap;
66
use Adldap\AdldapException;
77
use Adldap\AdldapInterface;
8-
use Adldap\Connections\ConnectionInterface;
98
use Adldap\Connections\Provider;
109
use Illuminate\Container\Container;
1110
use Illuminate\Support\Facades\Config;
1211
use Illuminate\Support\ServiceProvider;
12+
use Adldap\Connections\ConnectionInterface;
1313

1414
class AdldapServiceProvider extends ServiceProvider
1515
{

src/Auth/DatabaseUserProvider.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace Adldap\Laravel\Auth;
44

5+
use Adldap\Models\User;
56
use Adldap\Laravel\Commands\Import;
6-
use Adldap\Laravel\Commands\SyncPassword;
7-
use Adldap\Laravel\Events\AuthenticatedWithCredentials;
8-
use Adldap\Laravel\Events\AuthenticationRejected;
9-
use Adldap\Laravel\Events\AuthenticationSuccessful;
10-
use Adldap\Laravel\Events\DiscoveredWithCredentials;
117
use Adldap\Laravel\Events\Imported;
8+
use Illuminate\Support\Facades\Bus;
129
use Adldap\Laravel\Facades\Resolver;
10+
use Illuminate\Support\Facades\Event;
11+
use Illuminate\Support\Facades\Config;
12+
use Adldap\Laravel\Commands\SyncPassword;
1313
use Adldap\Laravel\Traits\ValidatesUsers;
14-
use Adldap\Models\User;
1514
use Illuminate\Auth\EloquentUserProvider;
1615
use Illuminate\Contracts\Auth\Authenticatable;
17-
use Illuminate\Support\Facades\Bus;
18-
use Illuminate\Support\Facades\Config;
19-
use Illuminate\Support\Facades\Event;
16+
use Adldap\Laravel\Events\AuthenticationRejected;
17+
use Adldap\Laravel\Events\AuthenticationSuccessful;
18+
use Adldap\Laravel\Events\DiscoveredWithCredentials;
19+
use Adldap\Laravel\Events\AuthenticatedWithCredentials;
2020

2121
class DatabaseUserProvider extends EloquentUserProvider
2222
{

src/Auth/NoDatabaseUserProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Adldap\Laravel\Auth;
44

5-
use Adldap\Laravel\Events\AuthenticatedWithCredentials;
6-
use Adldap\Laravel\Events\AuthenticationRejected;
7-
use Adldap\Laravel\Events\AuthenticationSuccessful;
8-
use Adldap\Laravel\Events\DiscoveredWithCredentials;
95
use Adldap\Laravel\Facades\Resolver;
6+
use Illuminate\Support\Facades\Event;
107
use Adldap\Laravel\Traits\ValidatesUsers;
11-
use Illuminate\Contracts\Auth\Authenticatable;
128
use Illuminate\Contracts\Auth\UserProvider;
13-
use Illuminate\Support\Facades\Event;
9+
use Illuminate\Contracts\Auth\Authenticatable;
10+
use Adldap\Laravel\Events\AuthenticationRejected;
11+
use Adldap\Laravel\Events\AuthenticationSuccessful;
12+
use Adldap\Laravel\Events\DiscoveredWithCredentials;
13+
use Adldap\Laravel\Events\AuthenticatedWithCredentials;
1414

1515
class NoDatabaseUserProvider implements UserProvider
1616
{

src/Commands/Console/Import.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
namespace Adldap\Laravel\Commands\Console;
44

5-
use Adldap\Laravel\Commands\Import as ImportUser;
6-
use Adldap\Laravel\Commands\SyncPassword;
7-
use Adldap\Laravel\Events\Imported;
8-
use Adldap\Laravel\Facades\Resolver;
9-
use Adldap\Models\User;
105
use Exception;
6+
use RuntimeException;
7+
use Adldap\Models\User;
8+
use UnexpectedValueException;
119
use Illuminate\Console\Command;
12-
use Illuminate\Database\Eloquent\Model;
10+
use Adldap\Laravel\Events\Imported;
1311
use Illuminate\Support\Facades\Bus;
14-
use Illuminate\Support\Facades\Config;
12+
use Adldap\Laravel\Facades\Resolver;
1513
use Illuminate\Support\Facades\Event;
16-
use RuntimeException;
17-
use UnexpectedValueException;
14+
use Illuminate\Support\Facades\Config;
15+
use Illuminate\Database\Eloquent\Model;
16+
use Adldap\Laravel\Commands\SyncPassword;
17+
use Adldap\Laravel\Commands\Import as ImportUser;
1818

1919
class Import extends Command
2020
{
@@ -74,7 +74,7 @@ public function handle()
7474
}
7575

7676
if (
77-
!$this->input->isInteractive() ||
77+
! $this->input->isInteractive() ||
7878
$this->confirm('Would you like these users to be imported / synchronized?', $default = true)
7979
) {
8080
$imported = $this->import($users);
@@ -167,7 +167,7 @@ public function display(array $users = [])
167167
*/
168168
public function isLogging() : bool
169169
{
170-
return !$this->option('no-log');
170+
return ! $this->option('no-log');
171171
}
172172

173173
/**
@@ -293,7 +293,7 @@ protected function delete(User $user, Model $model)
293293
{
294294
if (
295295
$this->isUsingSoftDeletes($model) &&
296-
!$model->trashed() &&
296+
! $model->trashed() &&
297297
$user->isDisabled()
298298
) {
299299
// If deleting is enabled, the model supports soft deletes, the model
@@ -316,7 +316,7 @@ protected function delete(User $user, Model $model)
316316
*/
317317
protected function model() : Model
318318
{
319-
if (!$this->model) {
319+
if (! $this->model) {
320320
$this->model = $this->option('model') ?? Config::get('ldap_auth.model') ?: $this->determineModel();
321321
}
322322

src/Commands/Import.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Adldap\Laravel\Commands;
44

5+
use Adldap\Models\User;
6+
use UnexpectedValueException;
57
use Adldap\Laravel\Events\Importing;
6-
use Adldap\Laravel\Events\Synchronized;
7-
use Adldap\Laravel\Events\Synchronizing;
88
use Adldap\Laravel\Facades\Resolver;
9-
use Adldap\Models\User;
10-
use Illuminate\Database\Eloquent\Model;
11-
use Illuminate\Support\Facades\Config;
129
use Illuminate\Support\Facades\Event;
13-
use UnexpectedValueException;
10+
use Illuminate\Support\Facades\Config;
11+
use Adldap\Laravel\Events\Synchronized;
12+
use Illuminate\Database\Eloquent\Model;
13+
use Adldap\Laravel\Events\Synchronizing;
1414

1515
class Import
1616
{
@@ -69,7 +69,7 @@ public function handle()
6969
// we'll create a new one for them.
7070
$model = $this->findUser() ?: $this->model->newInstance();
7171

72-
if (!$model->exists) {
72+
if (! $model->exists) {
7373
Event::dispatch(new Importing($this->user, $model));
7474
}
7575

src/Commands/SyncPassword.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Adldap\Laravel\Commands;
44

5-
use Illuminate\Database\Eloquent\Model;
6-
use Illuminate\Support\Facades\Config;
7-
use Illuminate\Support\Facades\Hash;
85
use Illuminate\Support\Str;
6+
use Illuminate\Support\Facades\Hash;
7+
use Illuminate\Support\Facades\Config;
8+
use Illuminate\Database\Eloquent\Model;
99

1010
class SyncPassword
1111
{
@@ -86,7 +86,7 @@ protected function passwordNeedsUpdate($password = null) : bool
8686
$current = $this->currentModelPassword();
8787

8888
if ($current !== null && $this->canSync()) {
89-
return !Hash::check($password, $current);
89+
return ! Hash::check($password, $current);
9090
}
9191

9292
return is_null($current);
@@ -99,7 +99,7 @@ protected function passwordNeedsUpdate($password = null) : bool
9999
*/
100100
protected function hasPasswordColumn() : bool
101101
{
102-
return !is_null($this->column());
102+
return ! is_null($this->column());
103103
}
104104

105105
/**

src/Commands/UserImportScope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Adldap\Laravel\Commands;
44

55
use Adldap\Laravel\Facades\Resolver;
6-
use Illuminate\Database\Eloquent\Builder;
76
use Illuminate\Database\Eloquent\Model;
87
use Illuminate\Database\Eloquent\Scope;
8+
use Illuminate\Database\Eloquent\Builder;
99

1010
class UserImportScope implements Scope
1111
{

src/Facades/Resolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Adldap\Laravel\Facades;
44

5-
use Adldap\Laravel\Resolvers\ResolverInterface;
65
use Illuminate\Support\Facades\Facade;
6+
use Adldap\Laravel\Resolvers\ResolverInterface;
77

88
/**
99
* @method static void setConnection(string $connection)

src/Listeners/BindsLdapUserModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Adldap\Laravel\Listeners;
44

5-
use Adldap\Laravel\Auth\DatabaseUserProvider;
65
use Adldap\Laravel\Facades\Resolver;
6+
use Illuminate\Support\Facades\Auth;
77
use Adldap\Laravel\Traits\HasLdapUser;
8+
use Adldap\Laravel\Auth\DatabaseUserProvider;
89
use Illuminate\Contracts\Auth\Authenticatable;
9-
use Illuminate\Support\Facades\Auth;
1010

1111
class BindsLdapUserModel
1212
{

0 commit comments

Comments
 (0)