Skip to content

Comments

Fix : type handling in CleanActivitylogCommand for --days option#1421

Closed
Ayoub-Mabrouk wants to merge 1 commit intospatie:mainfrom
Ayoub-Mabrouk:maxAgeInDays
Closed

Fix : type handling in CleanActivitylogCommand for --days option#1421
Ayoub-Mabrouk wants to merge 1 commit intospatie:mainfrom
Ayoub-Mabrouk:maxAgeInDays

Conversation

@Ayoub-Mabrouk
Copy link

Previously, the --days option passed to the activitylog:clean command or the configuration value 'delete_records_older_than_days' could be null or a string. This caused potential type issues when used with Carbon's subDays() method, which expects an integer.

This commit explicitly casts the value of to (int), ensuring consistent behavior and preventing runtime errors when calculating the cutoff date for old activity log records.

No changes to functionality; purely a type safety improvement.

Previously, the --days option passed to the activitylog:clean command
or the configuration value 'delete_records_older_than_days' could be
null or a string. This caused potential type issues when used with
Carbon's subDays() method, which expects an integer.

This commit explicitly casts the value of  to (int),
ensuring consistent behavior and preventing runtime errors when
calculating the cutoff date for old activity log records.

No changes to functionality; purely a type safety improvement.
@github-actions github-actions bot added the stale label Nov 9, 2025
@github-actions github-actions bot closed this Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant