-
Notifications
You must be signed in to change notification settings - Fork 144
[CLEANUP] Add an interface for components of a property value #506
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sabberworm\CSS\Value; | ||
|
||
/** | ||
* To be used by any class that represents a component of a CSS property value. | ||
* Values often comprise 'component operator component' (recursively). | ||
* This interface has no methods to implement; | ||
* its purpose is abstract: to allow a unique type to be specified when a `Component` is an argument of a method. | ||
*/ | ||
interface Component {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, we should check if there are any common methods that should be part of the interface so the interface is more than just a marker. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Looking again, I don't see any common methods, but do see that all of these classes extend So perhaps a better approach would be to simply use the |
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 also should make sure that the name makes sense globally (as Mermaid on GitHub doesn't allow namespaces). Maybe
CssPropertyValueComponent
oderPropertyValueComponent
?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 don't think whatever limitations of Mermaid there may be should dictate class naming conventions. Mermaid might in future be enhanced to show the namespaces. We should choose the most apt names for classes, interfaces and namespaces independently of whatever other tools we use.
The FQN is
Value\Component
. The namespaceValue
could perhaps bePropertyValue
(orProperty\Value
) for clarity, though any such rename would be beyond the scope of this PR, and probably unnecessary (it would be a breaking change).