This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Open
Conversation
Contributor
|
Seems reasonable but Fred has stronger opinions about this so I'll leave it to him. Some potential minor concerns:
|
Contributor
|
I'm fine with the intent of this diff, but not the bool argument; I'm fine with a shape argument, or the instance methods. The problem with static factory methods is it's not scalable if we want to add other options in the future. |
031136c to
da5fc0b
Compare
Contributor
Author
|
updated to use options shape 👍 |
fredemmott
reviewed
Feb 13, 2020
fredemmott
reviewed
Feb 13, 2020
|
|
||
| abstract class BaseRouter<+TResponder> { | ||
| public function __construct( | ||
| private BaseRouterOptions $options = shape('use_get_responder_for_head' => true) |
Contributor
There was a problem hiding this comment.
Perhaps ?BaseRouterOptions, and make all the fields optional?
This will be needed when a second option is added - it doesn't really matter now, but doing it would make it clearer what the 'right way' is to add one.
This would also need something like:
$this->options = shape(
'use_get_responder_for_head' => $options['use_get_responder_for_head'] ?? true
);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #15