- Status changed to Needs review
almost 2 years ago 10:50pm 28 January 2023 - πΊπΈUnited States tr Cascadia
#6 seems fine but it is old and needed to be re-rolled to bring it up to current standards. Here is a new version of that same patch.
- Status changed to RTBC
almost 2 years ago 2:52am 29 January 2023 - π¨π³China jungle Chongqing, China
-
+++ b/src/Plugin/DataType/IpAddressData.php @@ -0,0 +1,39 @@ + * label = @Translation("Ip address"),
IP address?
-
+++ b/src/Plugin/DataType/IpAddressData.php @@ -0,0 +1,39 @@ + public function getIp4Address(): ?string { +++ b/src/TypedData/Type/IpAddressInterface.php @@ -0,0 +1,30 @@ + public function getIp4Address(): ?string;
getIpV4Address()?
-
+++ b/src/Plugin/DataType/IpAddressData.php @@ -0,0 +1,39 @@ + public function getIp6Address(): ?string { +++ b/src/TypedData/Type/IpAddressInterface.php @@ -0,0 +1,30 @@ + public function getIp6Address(): ?string;
getIpV6Address()?
-
+++ b/src/Plugin/Validation/Constraint/IpConstraint.php @@ -0,0 +1,25 @@ + * label = @Translation("Ip", context = "Validation"),
IP?
Otherwise RTBC +1
-
- Status changed to Needs review
almost 2 years ago 2:53am 29 January 2023 - πΊπΈUnited States tr Cascadia
#1: Thanks, I missed that.
#2, #3: I don't know. Personally I would choose IPv4 and IPv6, because that is the canonical usage. But Drupal is different. I guess Drupal would demand IpV4 and IpV6, but I'm not sure. Do you really think Ipv4 and Ipv6 are better than (IPv4 and IPv6) or (IpV4 and IpV6)?
#4: No. The Symfony validation class is named "Ip" so we're stuck with that. - π¨π³China jungle Chongqing, China
#2, #3, I think it depends. If we treat IPv4/IPv6 as a word, then we can go with Ipv4/Ipv6. if we think it's two words -- IP + V4/V6, then it should be IpV4/IpV6,
E.g.
1. LinkedIn, it's a word, not Linked + In,
2. WeChat, it's a word. Not We + Chat.I would treat IPv4/IPv6 as a word. That's why I prefer Ipv4/Ipv6
- π¨π³China jungle Chongqing, China
#4 + * label = @Translation("Ip", context = "Validation"),
>#4: No. The Symfony validation class is named "Ip" so we're stuck with that.
Sorry, it may be unclear. I meant changing
Translation("Ip", context = "Validation"),
toTranslation("IP", context = "Validation"),
. Not the class name. - π¨π³China jungle Chongqing, China
If an acronym is used in a class or method name, make it CamelCase too (SampleXmlClass, not SampleXMLClass). [Note: this standard was adopted in March 2013, reversing the previous standard.]
In addition to #2, #3, yes, we can not use getIPv4Address/getIPv6Address. See https://www.drupal.org/docs/develop/standards/php/object-oriented-code#n... β
- πΊπΈUnited States tr Cascadia
OK, you have a good argument. I made the changes you suggested. I also added some text to a few documentation comments.
- Status changed to RTBC
over 1 year ago 3:01am 22 March 2023 -
TR β
committed ab9067e3 on 2.0.x authored by
dsdeiz β
Issue #3102290 by dsdeiz, jungle, TR: Create an IP Address datatype
-
TR β
committed ab9067e3 on 2.0.x authored by
dsdeiz β
- Status changed to Fixed
over 1 year ago 9:07pm 22 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.