-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
TASK: Code style adjust 5 internal usages of Object::none()
to ::createEmpty()
#5497
base: 9.0
Are you sure you want to change the base?
Conversation
…reateEmpty()` We had the discussion again how to name an empty object and for normal collections we used `createEmpty()` in the past and should continue to do so. The use of `none()` snuck in lately via the subscription engine. neos#5463 (comment)
Personally I disagree with a rule to use the same name everywhere because named constructors allow us to make the code more speaking and that is dependent on the specific type. However, I get the reasoning about being consistent too, and wouldn't block this ofc |
What @bwaidelich said, I think it's important that we write speaking code as much as possible. |
hmm jup i do understand that point too... and it seems we have a third player too These are the existing From what seems natural classes ending with Seeing at the existing usages this rule does not apply at all: And i think any rule would not be able to be carried out consistently because why should i rename the factory when i change the name to include I made this pr because it targets only internal factories ... and to enforce we have a unique way of instantiating empty things. After all it really doesnt matter that much i just like doing random things have good evening bye. Plural S - CommandHandler/Commands::createEmpty()
- Dimension/ContentDimensionValueVariationEdges::createEmpty()
- Feature/NodeCreation/Dto/NodeAggregateIdsByNodePaths::createEmpty()
- Feature/NodeModification/Dto/SerializedPropertyValues::createEmpty()
- Feature/NodeReferencing/Dto/SerializedNodeReferences::createEmpty()
- Feature/SubtreeTagging/Dto/SubtreeTags::createEmpty()
- NodeType/NodeTypeNames::createEmpty()
- Projection/ProjectionStates::createEmpty()
- Projection/ContentGraph/NodeAggregates::createEmpty()
- Projection/ContentGraph/Nodes::createEmpty()
- Projection/ContentGraph/NodeTags::createEmpty()
- Projection/ContentGraph/Subtrees::createEmpty()
- SharedModel/Node/NodeAggregateIds::createEmpty()
- SharedModel/Node/PropertyNames::createEmpty()
- SharedModel/Workspace/Workspaces::createEmpty()
- Domain/Model/WorkspaceRoleAssignments::createEmpty()
- FrontendRouting/Options::createEmpty() Suffix Collection / Set ... - Subscription/SubscriptionStatusCollection::createEmpty()
- Dimension/ContentDimensionConstraintSet::createEmpty()
- Domain/Service/NodeDuplication/NodeAggregateIdMapping::createEmpty() Others - Projection/ContentGraph/NodePath::createEmpty()
- Feature/NodeReferencing/Dto/NodeReferencesToWrite::createEmpty()
- Feature/NodeModification/Dto/PropertyValuesToWrite::createEmpty() |
i have no hobbies lol |
I feel like these are two distinct discussions, do we need the "create" prefix which suggests a constructor/factory method, and I feel it's good to have, but $depends, we won't have many static methods outside of static constructors, so it could be implied. then secondly is the empty/none distinction important? Commands::empty() vs Commands::none(), obviously createNone makes no sense, which I guess is why we have createEmpty only... |
…mpty()` We had the discussion at one point that we definitely prefer the `create` prefix here. And most of the code follows suit for this already.
I think we should go with this pr as it really streamlines things. And its really important to note that the things that have custom constructors now are NOT API - the things that are api where maybe a custom constructor would make sense are all named boringly |
We had the discussion again how to name an empty object and for normal collections we used
createEmpty()
in the past (25 present definitions) and should continue to do so. The use ofnone()
snuck in lately via the subscription engine.#5463 (comment)
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions