acquia / coding-standards-php

PHP_CodeSniffer rules (sniffs) for Acquia coding standards
GNU General Public License v2.0
19 stars 13 forks source link

Function naming convention #39

Closed vbouchet31 closed 2 years ago

vbouchet31 commented 2 years ago

The Drupal coding standards are saying: "Functions should in addition have the grouping/module name as a prefix, to avoid name collisions between modules."

However, when executing blt validate:phpcs with the default phpcs.xml.dist (containing <rule ref="AcquiaDrupalStrict"/>) the following code is accepted: mymodule.module

function super_function($variable) {

I would expect the validation to fail. The naming should be mymodule_super_function() or _mymodule_super_function().

vbouchet31 commented 2 years ago

I realised this repo is only a list of ruleset. I create an issue in coder issue queue: https://www.drupal.org/project/coder/issues/3271952

TravisCarden commented 2 years ago

Thanks, @vbouchet31. Let's close this issue for now since there's nothing immediately actionable on it. Please report back when the upstream issue is fixed and released.