Skip to content
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

Add documentation link for ClassExtendsInternalClassRule #284

Closed
mglaman opened this issue Dec 29, 2021 · 3 comments · Fixed by #286
Closed

Add documentation link for ClassExtendsInternalClassRule #284

mglaman opened this issue Dec 29, 2021 · 3 comments · Fixed by #286

Comments

@mglaman
Copy link
Owner

mglaman commented Dec 29, 2021

We recently added ClassExtendsInternalClassRule which detects when code extends @internal (#248) released in 1.1.2.

Turns out that Drupal's @internal policy can be far-reaching, such as forms.

Here is the policy on Drupal core and @internal: https://www.drupal.org/about/core/policies/core-change-policies/drupal-8-and-9-backwards-compatibility-and-internal-api#internal

Core modules contain many route controllers that are bound to individual routes, as well as form classes. These controllers are not part of the API of the module unless specifically marked with an @api tag on the method or class.

I think this project needs to provide some kind of documentation on what to do when this rule is activated and what it means, providing more context than the policy itself.

@mglaman
Copy link
Owner Author

mglaman commented Dec 29, 2021

The most common occurrence is due to \Drupal\Core\Entity\ContentEntityDeleteForm which extends ContentEntityConfirmFormBase but the code generation tool used by Console and Drush extend ContentEntityDeleteForm (I think Commerce always does as well.)

This class has been marked @internal and is to be discussed in https://www.drupal.org/node/2491057

@mglaman
Copy link
Owner Author

mglaman commented Dec 29, 2021

Related issue in Open Social: goalgorilla/open_social#2661

@mglaman
Copy link
Owner Author

mglaman commented Dec 29, 2021

We should only link to the Drupal core policy if the source class is from Drupal core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant