-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Implemented extra config builder extension point #102
base: 1.x
Are you sure you want to change the base?
Conversation
Third parties can register extra configuration, given a prefix and an ExtraConfigBuilder. All commands starting with the given prefix will be sent to the matching builder, that will return a custom ExtraSiteConfig object. Implementors are responsible for defining their own ExtraSiteConfig object, as well as their own ExtraConfigBuilder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some tests with a real ExtraConfigBuilder
class which returns a real SiteExtraConfig
?
Also, don't forget to run |
I didn't really clean it up before sending it. The idea was to let you see the big picture. |
I will. Review remarks fixed in the meanwhile. |
} else { | ||
$extraConfigItems[$prefix][$command][] = $val; | ||
} | ||
continue 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be continue
since you remove one level with the first if
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. A single continue
would continue from foreach (array_keys($this->extraConfigBuilders) as $prefix)
. As we have found an extra config matching the prefix, we want to continue from the next line (foreach ($lines as $line)
).
Third parties can register extra configuration, given a prefix and an
ExtraConfigBuilder
.All commands starting with the given prefix will be sent to the matching builder, that will return a custom
ExtraSiteConfig
object.Example:
Implementors are responsible for defining their own ExtraSiteConfig object, as well as their own
ExtraConfigBuilder
.