Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auditExclude merge versus replace #969

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gravitymedianet
Copy link

Allows for merging the local auditExclude values into the global exclude list instead of replacing it.

…lude

Allows for merging the model's audit exclude with the config default exclude list, instead of replacing it.
When getting the auditExclude values, check for global config  audit.exclude_merge property and merge if enabled, instead of replace. Otherwise, check locally at the model level.
Simplify the merge condition check
@@ -144,8 +144,7 @@ protected function resolveAuditExclusions()
public function getAuditExclude(): array
{
if (
Config::get('audit.exclude_merge', false) ||
($this->auditExcludeMerge ?? false)
$this->auditExcludeMerge ?? Config::get('audit.exclude_merge', false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you decided not to follow the instructions

the false is not necessary, the default is null and the null on a if is already false

if ($this->auditExcludeMerge ?? Config::get('audit.exclude_merge')) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, now I understand. Code updated.

Copy link

@parallels999 parallels999 Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code updated.

the 'false' is still there 😕

Copy link
Contributor

@willpower232 willpower232 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned by @parallels999, the , false) is not necessary

it would also be good to see a few tests for the different combinations of the auditExcludeMerge property and the config value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants