ProjectTransition: Use properties in constructor, not array.#1596
Open
bpfoley wants to merge 1 commit into
Open
ProjectTransition: Use properties in constructor, not array.#1596bpfoley wants to merge 1 commit into
bpfoley wants to merge 1 commit into
Conversation
Collaborator
Author
|
Test environment at https://www.pgdp.org/~bfoley/c.branch/pt-default |
cpeel
reviewed
Jul 11, 2026
| 'settings_template' => '', | ||
| 'collateral_actions' => null, | ||
| ] | ||
| project_restriction: null, |
Member
There was a problem hiding this comment.
Thoughts on not including the null ones in the definitions since that's the default value? It would make it more denser and perhaps make it easier to see what's unique about each of the definitions.
I'm on the fence about the idea but thought I'd toss it out there.
Collaborator
Author
There was a problem hiding this comment.
ACK. I thought about removing all the defaults, but I figured you had them in there for a reason, and they might be explicitly there to make it easier for the skim-reader. I'm happy to go either way.
Member
There was a problem hiding this comment.
This code predates my time at DP so it's been there for a while. Let's leave it like you have it.
cpeel
approved these changes
Jul 12, 2026
a296c96 to
f9e8848
Compare
This way is a bit denser, but more importantly, allows phpstan to statically check the types of all the arguments. While here, tighten up the types: * disabled_during_SR = null doesn't diff from false. * Make all the properties readonly.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This way is a bit denser, but more importantly, allows phpstan to statically check the types of all the arguments.
While here, tighten up the types: