-
-
Notifications
You must be signed in to change notification settings - Fork 223
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: Followup #4520 Introduce NodeType::tetheredNodeTypeDefinitions
#4906
!!! TASK: Followup #4520 Introduce NodeType::tetheredNodeTypeDefinitions
#4906
Conversation
As alternative trick we can as well make these hardcore mehtods internal like who really understands |
8dfe476
to
e224d4a
Compare
NodeTypeManager
should work on NodeTypeName
Todo these rector migration would need to be adjusted so they dont pass the
|
@bwaidelich as you also currently refactor the NodeTypeManager (#4999) ... do you think we should also incorporate this change (i yet have to fix ci but just want to know if its worth the effort) |
We'll have to since |
e224d4a
to
d14cc76
Compare
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.
Looks good in general. I stumled over the method names. Should we change them as we changed the parameter from NodeType to NodeTypeName?
E.g:
isNodeTypeAllowedAsChildToTetheredNode =>isNodeTypeNameAllowedAsChildToTetheredNode
Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php
Outdated
Show resolved
Hide resolved
good point but i dont think so as the thing the user of the api tries to solve if a NodeType is allowed or not ... that the node type is identified via NodeTypeName can be left out in the method name i think. Another thing i just remembered is that we want to be rather forgiving (see #4954) so i dont know if all the new |
That doesn't make sense to me. Yes, we pass in a node name but this method is about the allowed node type |
a00a096
to
aa06847
Compare
…stead of throwing
…t throw an exception
aa06847
to
9ad6b70
Compare
/** @phpstan-ignore-next-line */ | ||
public readonly TetheredNodeTypeDefinitions $tetheredNodeTypeDefinitions; | ||
|
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.
i applied a little hack here which is allowed even in php 8.3 and also documented. Its temporary but ugly.
All done to be forwards compatible with #4999, i just backported the TetheredNodeTypeDefinitions
vo and NodeType::tetheredNodeTypeDefinitions
cc @bwaidelich
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.
see also #4523 where i explain the hack and https://www.php.net/manual/en/language.oop5.properties.php
Readonly properties cannot be unset() once they are initialized. However, it is possible to unset a readonly property prior to initialization, from the scope where the property has been declared.
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.
we (christian basti me) discussed that we want to go with this hack for now with the vision that the nodeType will be at one point a simple model like:
public function __construct(
// ...
public readonly TetheredNodeTypeDefinitions $tetheredNodeTypeDefinitions,
// ...
) {}
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.
As stated in #4228 (comment) we will probably NOT have that "planned"/ beloved followup in Neos 9 as this is a bigger one and requires lots of work.
The assumption was that the followup will go in and we can remove the __get
hack again. We said for the (at that time) less likely event that the followup doesnt come, we will revert this and fallback to regular getters.
But there is one elephant in the room i was not aware of: Php8.4. It will come with support for such computed properties (see https://stitcher.io/blog/new-in-php-84#property-hooks-rfc) meaning we would have what we want at real language level supported.
The question is, can we live with this hack for the time until php 8.4 when we can refactor it to use the real get
hook?
My worst fear, that php wouldnt support our syntax forever is gone now at least :D
Wdyt cc @kitsunet
…pe()` Previously known as `NodeType::getAutoCreatedChildNodes`
9ad6b70
to
ab41496
Compare
NodeTypeManager
should work on NodeTypeName
NodeType::tetheredNodeTypeDefinitions
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.
👀
Introduces new value objects
TetheredNodeTypeDefinitions
andTetheredNodeTypeDefinition
(ported from #4999) to simplifyNodeType
andNodeTypeManager
api.Upgrade instructions
From 8.3
For upgrade from 9.0-dev please note that the temporary methods:
NodeTypeManager::getTetheredNodesConfigurationForNodeType
,NodeTypeManager::getTypeOfTetheredNode
,NodeType::hasTetheredNode
andNodeType::getNodeTypeNameOfTetheredNode
have been removed again and must be replaced withNodeType::$tetheredNodeTypeDefinitions
Review instructions
Ui part: neos/neos-ui#3782
Rector migrations will be provided as part of neos/rector#57
As said here #4520 (comment) writing
feels not right, the nodeTypeManger should just operate on NodeTypeNames.
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions