Skip to content

Commit

Permalink
Remove doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed Apr 17, 2023
1 parent 29e1685 commit e2fe78e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
12 changes: 2 additions & 10 deletions src/Models/Attributes/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ public static function nthash(string $password): string

/**
* Crypt password with an MD5 salt.
*
* @param string $salt
*/
public static function md5Crypt(string $password, string $salt = null): string
{
Expand All @@ -122,8 +120,6 @@ public static function md5Crypt(string $password, string $salt = null): string

/**
* Crypt password with a SHA256 salt.
*
* @param string $salt
*/
public static function sha256Crypt(string $password, string $salt = null): string
{
Expand All @@ -132,8 +128,6 @@ public static function sha256Crypt(string $password, string $salt = null): strin

/**
* Crypt a password with a SHA512 salt.
*
* @param string $salt
*/
public static function sha512Crypt(string $password, string $salt = null): string
{
Expand Down Expand Up @@ -188,10 +182,10 @@ protected static function makeCryptSalt(int $type): string
protected static function makeCryptPrefixAndLength(int $type): array
{
return match ((int) $type) {
static::CRYPT_SALT_TYPE_MD5 => ['$1$', 12],
static::CRYPT_SALT_TYPE_MD5 => ['$1$', 12],
static::CRYPT_SALT_TYPE_SHA256 => ['$5$', 16],
static::CRYPT_SALT_TYPE_SHA512 => ['$6$', 16],
default => throw new InvalidArgumentException("Invalid crypt type [$type]."),
default => throw new InvalidArgumentException("Invalid crypt type [$type]."),
};
}

Expand All @@ -209,8 +203,6 @@ public static function getHashMethod(string $password): ?string

/**
* Attempt to retrieve the hash method and algorithm used for the password.
*
* @return array|void
*/
public static function getHashMethodAndAlgo(string $password): ?array
{
Expand Down
6 changes: 2 additions & 4 deletions src/Models/Concerns/HasPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ protected function setPassword(string $password, string $attribute): void
/**
* Encode / hash the given password.
*
* @param string $salt
*
* @throws LdapRecordException
*/
protected function getHashedPassword(string $method, string $password, string $salt = null): string
Expand Down Expand Up @@ -213,10 +211,10 @@ public function determinePasswordHashMethod()
);

return match ((int) $algo) {
Password::CRYPT_SALT_TYPE_MD5 => 'md5'.$method,
Password::CRYPT_SALT_TYPE_MD5 => 'md5'.$method,
Password::CRYPT_SALT_TYPE_SHA256 => 'sha256'.$method,
Password::CRYPT_SALT_TYPE_SHA512 => 'sha512'.$method,
default => $method,
default => $method,
};
}
}
19 changes: 7 additions & 12 deletions src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Builder
*/
public array $filters = [
'and' => [],
'or' => [],
'or' => [],
'raw' => [],
];

Expand Down Expand Up @@ -150,9 +150,6 @@ public function setCache(Cache $cache = null): static

/**
* Returns a new Query Builder instance.
*
* @param string $baseDn
* @return $this
*/
public function newInstance(string $baseDn = null): static
{
Expand Down Expand Up @@ -281,8 +278,6 @@ public function getBaseDn(): ?string

/**
* Get the distinguished name of the query.
*
* @return string
*/
public function getDn(): ?string
{
Expand Down Expand Up @@ -479,9 +474,9 @@ public function forPage(int $page = 1, int $perPage = 100, string $orderBy = 'cn

$this->addControl(LDAP_CONTROL_VLVREQUEST, true, [
'before' => 0,
'after' => $perPage - 1,
'after' => $perPage - 1,
'offset' => ($page * $perPage) - $perPage + 1,
'count' => 0,
'count' => 0,
]);

return $this->get();
Expand Down Expand Up @@ -1559,11 +1554,11 @@ protected function logQuery(Builder $query, string $type, float $time = null): v
$args = [$query, $time];

$event = match ($type) {
'read' => new Events\Read(...$args),
'chunk' => new Events\Chunk(...$args),
'listing' => new Events\Listing(...$args),
'read' => new Events\Read(...$args),
'chunk' => new Events\Chunk(...$args),
'listing' => new Events\Listing(...$args),
'paginate' => new Events\Paginate(...$args),
default => new Events\Search(...$args),
default => new Events\Search(...$args),
};

$this->fireQueryEvent($event);
Expand Down

0 comments on commit e2fe78e

Please sign in to comment.