Skip to content

Commit

Permalink
Merge pull request #48 from Laragear/feat/php-8.4
Browse files Browse the repository at this point in the history
[3x] PHP 8.4 support
  • Loading branch information
DarkGhostHunter authored Jan 29, 2025
2 parents ccccb37 + df252f6 commit bccf1f1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/.editorconfig export-ignore
/composer.lock export-ignore
/.styleci.yml export-ignore
/phpstan.neon export-ignore
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- 8.1
- 8.2
- 8.3
- 8.4
laravel-constraint:
- 10.*
- 11.*
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
ignoreErrors:
- '#Trait Laragear\\Rut\\HasRut is used zero times and is not analysed\.#'
2 changes: 1 addition & 1 deletion src/Exceptions/EmptyRutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EmptyRutException extends LogicException implements RutException
public function __construct(
string $message = 'The RUT needs at least 7 valid characters.',
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidRutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class InvalidRutException extends LogicException implements RutException
public function __construct(
string $message = 'The given RUT is invalid.',
int $code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/RutUnique.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
*
* @return $this
*/
public function ignore(mixed $id, string $idColumn = null): RutUnique
public function ignore(mixed $id, ?string $idColumn = null): RutUnique
{
if ($id instanceof Model) {
return $this->ignoreModel($id, $idColumn);
Expand Down
4 changes: 2 additions & 2 deletions src/Rut.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function isNotEqual(self|int|string $rut): bool
/**
* Formats the RUT to a string using the default style or the given style.
*/
public function format(RutFormat $format = null): string
public function format(?RutFormat $format = null): string
{
$format ??= static::$format;

Expand Down Expand Up @@ -296,7 +296,7 @@ public static function map(iterable $ruts): Collection
* @param int|string|null $vd
* @return bool
*/
public static function check(int|string $num, int|string $vd = null): bool
public static function check(int|string $num, int|string|null $vd = null): bool
{
// If the developer only issued the num, we will understand is the whole RUT.
if (null === $vd) {
Expand Down

0 comments on commit bccf1f1

Please sign in to comment.