@sebastian yes, what I mean is that the use case is a niche often covered by @see, and more often caused by rename and subsequent deprecation
@see is often used when one method needs to be able to _reference_ another method -- such as when they're related to each other. (This was precisely why I didn't propose a @related tag as well.)
@alias would be used when one method is _identical_ to another in every way. It is, quite literally, an alias.
Something that might be more interesting is to see if we can alter
@see in such a way that you are able to optionally add a 'type' of
relation. This way you could model it without making it overly complex
for the code author (and it might even be possible to deprecate @uses
and @link).
On Oct 10, 2012, at 11:45 PM, Mike van Riel <draco...@gmail.com> wrote:What do you actually see being used in the real world? Concrete examples would be helpful. :)
> @alias would be a specialization of @see, to identify a single
> purpose. There are other types of relations that can be expressed, is
> it wise to introduce a new tag for each of those?
Arguably, that has nothing to do with the tags, and more to do with the absolute mess of a site phpDocumentor 1.x has. If people can't *find* the documentation, they can't *use* the documentation.
> I see in the field
> that people have trouble distinguishing between @link and @see; why
> would this be any different for @alias?
IMO, it depends on what you're doing. For example, say you're implementing some kind of collection and you want a method that returns true if all of the entries match a particular pattern.
> Especially given how often you
> would use such a tag (imo: seldom if you write proper code and do not
> have to maintain a huge BC).
Would you call that method every() or all()?
The truth is, you can call it both by aliasing one to the other. Some users will remember all() while others will remember every(). When we document them, we can simply say "these are the same". The @alias annotation makes that easier.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Thu, Oct 11, 2012 at 11:20 AM, Sebastian Krebs <kreb...@gmail.com> wrote:I disagree. There are lots of great reasons for aliases. You just
> Really: Your example is really no valid case for useful alias. There is
> absolutely no reason to habe both methods, except "some will remember x()
> better than y()" ...
found one example that you disagreed with :)
Aliases are almost essential when implementing standard interfaces...
Take ArrayAccess: offsetExists() is almost always an alias for has(),
offsetGet() is almost always an alias for get() or find(). If the same
class implements property overloading as well, __get(), __set(),
__isset() and __unset() will be aliases too.
Classes using PSR-[23] naming conventions which implement a stream
wrapper should probably alias all the non-camelcase methods to proper
PSR-[23] method names.
A template class might implement __invoke() as an alias to render().
And by "might" I mean "at least one definitely does":
http://hile.mn/RjgFvm
Aliases can also provide a more expressive interface, especially with
DSLs and fluent interfaces.
-- j
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Example:
`@see my_method() :alias: to provide a method that matches the Coding Standard`
2nd example:
`@see http://manual.phpdoc.org :manual: to provide details regarding
the use of phpDocumentor v1`
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Oct 11, 2012, at 2:28 PM, Sebastian Krebs <kreb...@gmail.com> wrote:Okay, these are good examples.
> @see otherMethod() :reverse: (for example utf8encode()/utf8decode())
> @see otherMethod() :equivalent: (for example array_chunk() (split an array), str_split() (split strings). Maybe not a good example)
> @see otherMethod() :specilization: (for example strncmp() is a specilization of strcmp())
> @see otherMethod() :generalization: (opposite of specilization)
> @see otherMethod() :similar: (something like "alias", but with a minor difference. No example ;) Maybe strcmp()/strncmp() too. In fact the whole str*cmp()-family)
> @see otherMethod() :related: (kind of how @see is right now)
But there are two things that I want to bring up. Let the flaming begin. :)
1. How is this _really_ any different from adding entirely new tags?
@reverse
@equivalent
@specialization
@generalization
@similar
@related
Practically speaking, how are these any different?
2. These new :<keyword>: tags will need to be supported and understood by documentation tools.
How is maintaining a list of supported keywords any different from (a) supporting the service shorthands I proposed for the @author tag, and (b) supporting the license shorthands that the PHPDoc PSR already supports for @license?
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To post to this group, send email to php...@googlegroups.com.
To unsubscribe from this group, send email to php-fig+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I don't think that many tags are the problem, but documentation of these tags is important.