Skip to content

[6.x] Change shouldBootRootItems visibility in AddonServiceProvider#14831

Closed
marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:feat/only-protect-method
Closed

[6.x] Change shouldBootRootItems visibility in AddonServiceProvider#14831
marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:feat/only-protect-method

Conversation

@marcorieser

@marcorieser marcorieser commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR changes shouldBootRootItems visibility from private to protected, so inheriting classes can use it.

For example, I want to overwrite the logic of how my addon config is published and still prevent multiple boots by calling this from within the overwritten bootConfig() method:

protected function bootConfig()
{
    if (! $this->shouldBootRootItems()) {
        return $this;
    }

@jasonvarga

Copy link
Copy Markdown
Member

What would you be changing?

@marcorieser

Copy link
Copy Markdown
Contributor Author

I want to publish to a directory in the config folder.

@marcorieser

Copy link
Copy Markdown
Contributor Author

Just realized that shouldBootRootItems() calls other private methods and accesses a private property. This needs a bit more thinking I guess.

@jasonvarga

Copy link
Copy Markdown
Member

I'll close this for the moment, but if you can show a full example of what you plan to do, we can revisit it.

Changing a private method to protected means we need to think about how people would be overriding etc.

@jasonvarga jasonvarga closed this Jun 19, 2026
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.

2 participants