Skip to content

Commit

Permalink
Run updated Laravel Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Oct 18, 2024
1 parent 93ef5cf commit e9c14d3
Show file tree
Hide file tree
Showing 74 changed files with 385 additions and 417 deletions.
2 changes: 1 addition & 1 deletion src/ConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ConnectionManager
/**
* Constructor.
*/
public function __construct($dispatcher = new Dispatcher())
public function __construct($dispatcher = new Dispatcher)
{
$this->dispatcher = $dispatcher;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function __callStatic(string $method, array $parameters): mixed
/**
* Constructor.
*/
public function __construct(ConnectionManager $manager = new ConnectionManager())
public function __construct(ConnectionManager $manager = new ConnectionManager)
{
$this->manager = $manager;
}
Expand Down
3 changes: 1 addition & 2 deletions src/DetailedError.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public function __construct(
protected int $errorCode,
protected string $errorMessage,
protected ?string $diagnosticMessage
) {
}
) {}

/**
* Get the LDAP error code.
Expand Down
2 changes: 1 addition & 1 deletion src/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ protected function createClassCallable(string $listener): callable
{
[$class, $method] = $this->parseListenerCallback($listener);

return [new $class(), $method];
return [new $class, $method];
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Events/NullDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public function until(string|object $event, mixed $payload = []): ?array
/**
* Fire an event and call the listeners.
*/
public function fire(string|object $event, mixed $payload = [], bool $halt = false): void
{
}
public function fire(string|object $event, mixed $payload = [], bool $halt = false): void {}

/**
* Fire an event and call the listeners.
Expand Down
3 changes: 1 addition & 2 deletions src/LdapResultResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public function __construct(
public readonly ?string $errorMessage = null,
public readonly ?array $referrals = null,
public readonly ?array $controls = null,
) {
}
) {}

/**
* Determine if the LDAP response indicates a successful status.
Expand Down
2 changes: 1 addition & 1 deletion src/Models/ActiveDirectory/ExchangeDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public static function boot(): void
{
parent::boot();

static::addGlobalScope(new Scopes\InConfigurationContext());
static::addGlobalScope(new Scopes\InConfigurationContext);
}
}
4 changes: 2 additions & 2 deletions src/Models/ActiveDirectory/ExchangeServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function boot(): void
{
parent::boot();

static::addGlobalScope(new Scopes\HasServerRoleAttribute());
static::addGlobalScope(new Scopes\InConfigurationContext());
static::addGlobalScope(new Scopes\HasServerRoleAttribute);
static::addGlobalScope(new Scopes\InConfigurationContext);
}
}
2 changes: 1 addition & 1 deletion src/Models/Attributes/TSPropertyArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(mixed $tsPropertyArray = null)
$tsPropertyArray = $tsPropertyArray ?: self::DEFAULTS;

foreach ($tsPropertyArray as $key => $value) {
$tsProperty = new TSProperty();
$tsProperty = new TSProperty;

$this->tsProperty[$key] = $tsProperty->setName($key)->setValue($value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Attributes/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function convertWindowsIntegerTimeToDateTime(string|int|null $value =
return (int) $value;
}

return (new DateTime())->setTimestamp(
return (new DateTime)->setTimestamp(
round($value / 10000000) - 11644473600
);
}
Expand Down
4 changes: 1 addition & 3 deletions src/Models/Concerns/CanAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public function getRememberToken(): string
/**
* Set the token value for the "remember me" session.
*/
public function setRememberToken($value): void
{
}
public function setRememberToken($value): void {}

/**
* Get the column name for the "remember me" token.
Expand Down
2 changes: 1 addition & 1 deletion src/Models/FreeIPA/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected static function boot(): void
// Here we'll add a global scope to all FreeIPA models to ensure the
// Entry UUID is always selected on each query. This attribute is
// virtual, so it must be manually selected to be included.
static::addGlobalScope(new AddEntryUuidToSelects());
static::addGlobalScope(new AddEntryUuidToSelects);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static function make(array $attributes = []): static
*/
public static function on(?string $connection = null): Builder
{
$instance = new static();
$instance = new static;

$instance->setConnection($connection);

Expand All @@ -253,7 +253,7 @@ public static function getRootDse(?string $connection = null): Model
/** @var Model $model */
$model = static::getRootDseModel();

return $model::on($connection ?? (new $model())->getConnectionName())
return $model::on($connection ?? (new $model)->getConnectionName())
->in()
->read()
->whereHas('objectclass')
Expand All @@ -267,7 +267,7 @@ public static function getRootDse(?string $connection = null): Model
*/
protected static function getRootDseModel(): string
{
$instance = new static();
$instance = new static;

return match (true) {
$instance instanceof Types\ActiveDirectory => ActiveDirectory\Entry::class,
Expand Down Expand Up @@ -1082,7 +1082,7 @@ public static function destroy(mixed $dns, bool $recursive = false): int
{
$count = 0;

$instance = new static();
$instance = new static;

if ($dns instanceof Collection) {
$dns = $dns->modelDns()->toArray();
Expand Down
2 changes: 1 addition & 1 deletion src/Models/ModelDoesNotExistException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ModelDoesNotExistException extends LdapRecordException
*/
public static function forModel(Model $model): static
{
return (new static())->setModel($model);
return (new static)->setModel($model);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Models/OpenLDAP/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected static function boot(): void
// Here we'll add a global scope to all OpenLDAP models to ensure the
// Entry UUID is always selected on each query. This attribute is
// virtual, so it must be manually selected to be included.
static::addGlobalScope(new AddEntryUuidToSelects());
static::addGlobalScope(new AddEntryUuidToSelects);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function getDefaultModel(): string
*/
public function getNewDefaultModel(): Model
{
$model = new $this->default();
$model = new $this->default;

$model->setConnection($this->parent->getConnectionName());

Expand Down
6 changes: 3 additions & 3 deletions src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class Builder
public function __construct(Connection $connection)
{
$this->connection = $connection;
$this->grammar = new Grammar();
$this->grammar = new Grammar;
}

/**
Expand Down Expand Up @@ -686,11 +686,11 @@ public function sole(array|string $columns = ['*']): Model|array
$result = $this->limit(2)->get($columns);

if (empty($result)) {
throw new ObjectsNotFoundException();
throw new ObjectsNotFoundException;
}

if (count($result) > 1) {
throw new MultipleObjectsFoundException();
throw new MultipleObjectsFoundException;
}

return reset($result);
Expand Down
2 changes: 0 additions & 2 deletions src/Query/Events/QueryExecuted.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class QueryExecuted

/**
* The number of milliseconds it took to execute the query.
*
* @var ?float
*/
protected ?float $time;

Expand Down
4 changes: 1 addition & 3 deletions src/Query/Filter/ParserException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use LdapRecord\LdapRecordException;

class ParserException extends LdapRecordException
{
}
class ParserException extends LdapRecordException {}
2 changes: 1 addition & 1 deletion src/Query/Model/ActiveDirectoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function whereEnabled(): static
public function whereDisabled(): static
{
return $this->rawFilter(
(new AccountControl())->setAccountIsDisabled()->filter()
(new AccountControl)->setAccountIsDisabled()->filter()
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/Query/MultipleObjectsFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use LdapRecord\LdapRecordException;

class MultipleObjectsFoundException extends LdapRecordException
{
}
class MultipleObjectsFoundException extends LdapRecordException {}
4 changes: 1 addition & 3 deletions src/Query/ObjectsNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use LdapRecord\LdapRecordException;

class ObjectsNotFoundException extends LdapRecordException
{
}
class ObjectsNotFoundException extends LdapRecordException {}
4 changes: 1 addition & 3 deletions src/Testing/AuthGuardFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ class AuthGuardFake extends Guard
/**
* Always allow binding as configured user.
*/
public function bindAsConfiguredUser(): void
{
}
public function bindAsConfiguredUser(): void {}
}
4 changes: 1 addition & 3 deletions src/Testing/LdapExpectationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Exception;

class LdapExpectationException extends Exception
{
}
class LdapExpectationException extends Exception {}
2 changes: 1 addition & 1 deletion src/Testing/LdapFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function parseResult(mixed $result, int &$errorCode = 0, ?string &$dn = n
{
return $this->hasExpectations(__FUNCTION__)
? $this->resolveExpectation(__FUNCTION__, func_get_args())
: new LdapResultResponse();
: new LdapResultResponse;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Concerns/MakePosixUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait MakePosixUsers
{
protected function makePosixUser(Model $ou, array $attributes = []): PosixAccount
{
return (new PosixAccount())
return (new PosixAccount)
->inside($ou)
->fill(array_merge([
'uid' => $this->faker()->userName(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Concerns/MakesGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait MakesGroups
{
protected function makeGroup(Model $ou, array $attributes = []): Group
{
return (new Group())
return (new Group)
->inside($ou)
->fill(array_merge(
['cn' => $this->faker()->name()],
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Concerns/MakesPosixGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait MakesPosixGroups
{
protected function makePosixGroup(Model $ou, array $attributes = []): PosixGroup
{
return (new PosixGroup())
return (new PosixGroup)
->inside($ou)
->fill(array_merge([
'cn' => $this->faker()->name(),
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Concerns/MakesUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait MakesUsers
{
protected function makeUser(Model $ou, array $attributes = []): User
{
return (new User())
return (new User)
->inside($ou)
->fill(array_merge([
'uid' => $this->faker()->userName(),
Expand Down
Loading

0 comments on commit e9c14d3

Please sign in to comment.