API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Access%21...

> Most checkers should prefer DENY

This should be fully quantified so it forms a link on api.d.org

Comments

jhodgdon’s picture

Title: quantify constant in docs for AccessInterface::KILL » Add class to constant in docs for AccessInterface::KILL

Yes, and while we're in there, maybe we could take out the line that says that AccessInterface::KILL overrides itself? :)

I am not sure "quantify" is clear to Novice contributors (I scratched my head a bit?) -- what is needed is for the constant to have the class name on it: AccessInterface::DENY presumably.

joachim’s picture

Sorry, I thought 'quantify' was the PHP term for giving the name space. Maybe I was thinking of 'qualify'?

jhodgdon’s picture

You may be right, I'm not sure. Probably "qualify" though, as in "fully-qualified namespace"? Anyway, we don't actually need the namespace, just the class name (as you can see on the existing page, AccessInterface::KILL turned into a link without the namespace).

Anonymous’s picture

I attached a patch, thanks for the oppurtunity!

Anonymous’s picture

I added the classname AccessInterface to the constant DENY.

kokobutter’s picture

i confuse at want is asking for. is it asking for a class name and that all

kokobutter’s picture

I change the wording a little to be easier to understand.

joachim’s picture

Status: Active » Needs work

Thanks both of you!

The wording of the second patch is a little clearer, but the way the class name is used is correct in the first patch. It should be 'AccessInterface::DENY', because the api module on api.drupal.org will parse that string and turn it into a link to that constant.

Anonymous’s picture

I added the Class name and made the definition clearer

dawehner’s picture

what about using static::DENY?

Anonymous’s picture

Status: Needs work » Needs review
joachim’s picture

+++ b/core/lib/Drupal/Core/Access/AccessInterface.php
@@ -34,7 +34,8 @@
+   * should prefer AccessInterface::DENY, Constant of same class
+   * AccessInterface.

There's no need to explain where it's a defined as a constant. Writing it with the interface name will make the API module output it as a link, so the context is clear.

> what about using static::DENY?

That won't link then will it?

dawehner’s picture

Well, api.drupal.org should support it. It is kinda helpful to make it clear on the semantic level that it is this level.

jhodgdon’s picture

Status: Needs review » Needs work

static::DENY will link properly inside code, but not (at this time) inside documentation blocks. It would be kind of a pain to make it work in doc blocks -- not horrible, but kind of a pain -- so for now I'd prefer to just put the AccessInterface::DENY in there. We have used this way of referring to class methods/constants all over other doc blocks.

So can we just go back to the patch in #4? Except, the wording of this sentence is very awkward for a native English speaker... Could we rewrite the sentence to say "In most cases, using AccessInterface::DENY is preferable." please?

Anonymous’s picture

I updated the docs to remove unecessary text.

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

OK, good enough, thanks!

Note: We are in a pre-alpha-release period through Wed the 19th, where only critical and major issues can be committed (this one is "minor", so it will have to wait).

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 8.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.