--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/5fa24b40-1b48-4c0e-907b-3fc88cc965dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I disagree for exactly that reason. :-)
If the goal is interoperability, then containers need to have at least a common baseline of what they should allow. It's essentially an additional layer of type checking beyond just "string". That doesn't mean it has to specify a dot-delimited format, or require/disallow /, or whatever. Just the legal world of opaque strings.
I believe PSR-6's definition allows any UTF-8 character, so that would include pizza emoji. :-) However, if I'm trying to connect two containers (for delegation), and one uses a pizza emoji and the other only allows ASCII characters, then they're not actually compatible. (Or, god forbid, one tries to use Windows-1252 for some ungodly reason.) Or perhaps one is limited to only 5 character strings for some reason (stored in a database column)? Then passing in a longer string wouldn't work.
PSR-6's requirement was simply "at leas a 64 character UTF-8 string, and these chars are reserved". If you don't want to reserve the same/any characters that's fine, but at least a character encoding and minimum legal length should be specified.
--Larry Garfield
On 11/03/2016 03:47 AM, David Négrier wrote:
I agree with Matthieu.--
Specifying what legal characters are supported definitely belongs to another PSR (the one where we put things into the container). I'll propose a PR in container-interop/service-provider to define precisely the allowed identifiers.
Unlike PSR-6, there is no "set" in this PSR, therefore no need to standardize the acceptable identifiers. For PSR-11, if the identifier passed is "🍕" (the pizza slice emoji) and the container does not support emoji identifiers (what a shame! :) ), the container should return a NotFoundException.
David.
Le mercredi 2 novembre 2016 22:49:33 UTC+1, Matthieu Napoli a écrit :Splitting of the main thread, quoting Larry:
> The spec should specify what legal characters are for an entryidentifier, and what if any reserved characters there are. It should
also specify minimum supported key length and character sets, for
completeness. I recommend borrowing PSR-6's language here, which I
believe addresses this area well. Whether it uses the same reserved
character list or another one I don't feel strongly about. I would not
consider this a Review-breaking change.
Why should we specify that? This is explicitly a "non-goal" of PSR-11: https://github.com/php-fig/fig-standards/blob/master/proposed/container-meta.md#32-non-goals
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/5fa24b40-1b48-4c0e-907b-3fc88cc965dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/074d736b-f5b4-db27-765a-814de60387c7%40garfieldtech.com.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/5fa24b40-1b48-4c0e-907b-3fc88cc965dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/074d736b-f5b4-db27-765a-814de60387c7%40garfieldtech.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/471a6868-f78a-40f7-a16b-212d64f6eaef%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/I2CPPp0Su-Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/747f1318-fcad-54c5-15db-c056f500bbfa%40garfieldtech.com.
I filed a PR here with my recommendation:
https://github.com/php-fig/fig-standards/pull/837
Thanks.
--Larry Garfield
Thanks, I feel it's easier to discuss that now:
> An entry identifier is a string of at least one character that uniquely identifies an item within a container.
Sounds good to me, an empty string would be, IMO, problematic. And it wouldn't surprise me that many containers would throw an exception with an empty identifier (I even wonder if PHP-DI does it :p).
Is "uniquely" an issue? With aliases (for example) 2 IDs can identify the same entry.
> Implementing libraries MUST support identifiers consisting of the characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding and a length of up to 64 characters.
That list of characters doesn't include \ which is used by all autowiring containers (where the ID is the class name). This is IMO an example of a problem with enumerating all allowed characters: we are bound to miss some. Same for "-" which is currently not allowed. What if someone wants to name a service with an emoji? (for whatever reasons).
And I understand you said you wanted to place a "lower bound", but if some containers don't support "\" then it's a big issue with interoperability.
Another problem I see is the max length: why such a maximum? It doesn't seem very high either, though of course in most cases it would be fine.
I would suggest something like that instead:
> [An entry identifier is a string of at least one character that uniquely identifies an item within a container.] It can consist of any characters in UTF-8 encoding.
> Implementing libraries MAY support additional characters and encodings or longer lengths, but must support at least that minimum.
IMO we can get rid of this sentence because this is exactly the Liskov Substitution Principle and we removed the sentence about extra optional parameters for "get()" for the same reason.
> An entry identifier is an opaque string, so callers SHOULD NOT assume that the structure of the string caries any semantic meaning.
After thinking about it I've switched from "I don't see the point" to "it's a good idea": some containers use for example "." as a separator/way to namespace entries, it's good to clear up any potential confusion here: it's just a string, conventions and structure can come later but they are out of scope of PSR-11.
Matthieu
I filed a PR here with my recommendation:
https://github.com/php-fig/fig-standards/pull/837
Thanks.
--Larry GarfieldThanks, I feel it's easier to discuss that now:
> An entry identifier is a string of at least one character that uniquely identifies an item within a container.
Sounds good to me, an empty string would be, IMO, problematic. And it wouldn't surprise me that many containers would throw an exception with an empty identifier (I even wonder if PHP-DI does it :p).
Is "uniquely" an issue? With aliases (for example) 2 IDs can identify the same entry.
> Implementing libraries MUST support identifiers consisting of the characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding and a length of up to 64 characters.
That list of characters doesn't include \ which is used by all autowiring containers (where the ID is the class name). This is IMO an example of a problem with enumerating all allowed characters: we are bound to miss some. Same for "-" which is currently not allowed. What if someone wants to name a service with an emoji? (for whatever reasons).
And I understand you said you wanted to place a "lower bound", but if some containers don't support "\" then it's a big issue with interoperability.
Another problem I see is the max length: why such a maximum? It doesn't seem very high either, though of course in most cases it would be fine.
I would suggest something like that instead:
> [An entry identifier is a string of at least one character that uniquely identifies an item within a container.] It can consist of any characters in UTF-8 encoding.
> Implementing libraries MAY support additional characters and encodings or longer lengths, but must support at least that minimum.
IMO we can get rid of this sentence because this is exactly the Liskov Substitution Principle and we removed the sentence about extra optional parameters for "get()" for the same reason.
> An entry identifier is an opaque string, so callers SHOULD NOT assume that the structure of the string caries any semantic meaning.
After thinking about it I've switched from "I don't see the point" to "it's a good idea": some containers use for example "." as a separator/way to namespace entries, it's good to clear up any potential confusion here: it's just a string, conventions and structure can come later but they are out of scope of PSR-11.
> Implementing libraries MUST support identifiers consisting of the characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding and a length of up to 64 characters.
--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/I2CPPp0Su-Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/8f1f9936-a771-4a13-b560-42cefaf295f8%40googlegroups.com.
After discussion with Larry last night I suggested an edit that states that all containers should support a valid PHP string in UTF-8 format. I made that suggestion on the pull request.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/8f9916d0-1ff4-4c6a-993a-54e90139eceb%40googlegroups.com.