[meta] Fix 'Drupal.NamingConventions.ValidFunctionName' coding standard

Created on 28 March 2020, over 4 years ago
Updated 31 July 2024, about 1 month ago

Problem/Motivation

Part of 🌱 [meta] Fix PHP coding standards in core Active .

Add sniff Drupal.NamingConventions.ValidFunctionName"

Steps to reproduce

Proposed resolution

Remaining tasks

  1. πŸ“Œ Use 'Drupal.NamingConventions.ValidFunctionName' in core/tests RTBC
  2. πŸ“Œ Use 'Drupal.NamingConventions.ValidFunctionName' in module tests RTBC
  3. πŸ“Œ Use 'Drupal.NamingConventions.ValidFunctionName' in non tests RTBC
  4. πŸ“Œ Clean up Unicode function names Needs work
  5. πŸ“Œ Public method name "EntityField::render_item" is not | | in lowerCamel format Active
  6. Final issue to fix any remaining problems
πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 7 hours ago

Created by

πŸ‡¨πŸ‡³China jungle Chongqing, China

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Are we sure about this change? There is a PHP class \DOMXPath. I'm not sure that this is a good rule to implement in core for two reasons.

    • PHP does not care about case for method names. If a class has a method getXPath() and I call getxpath() it'll work just fine.
    • We might be forcing developers to make bad choices for no reason. For example, say you work for the BBC and you implementing a method getBBCListing() - there is probably a corporate standard that says BBC must always be capitalised but our coding standards prevent that. I'm not saying I particularly like the method name getBBCListing() but I'm not sure that our coding standards should have an opinion. Also if you are extending PHP's classes you have things like \DOMNode::C14N and \DOMNode::C14NFile.

    Re-posting from a sub issue.

  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand
Production build 0.71.5 2024