part of #2011290: [meta] standards cleanup to get ready for getting into core

Motivation

Lots of classes are using properties with underscore pattern like in ConfigGroupMapper.php

  private $base_path = '';

Proposed resolution

Change properties to camelCase.

Remaining tasks

  • verify in the standards properties should be camelCase
  • make initial patch

User interface changes

No

API changes

No

CommentFileSizeAuthor
#1 camelCase-2028127-1.patch10.56 KBlazysoundsystem
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lazysoundsystem’s picture

Status: Active » Needs review
FileSize
10.56 KB

Couldn't find a categorical statement of the coding standards for camelCase, but for this in the coder module's good.php:

  // Public properties don't have a prefix.
  protected $foo = 1;

  // Longer properties use camelCase naming.
  public $barProperty = 1;

  // Public static variables use camelCase, too.
  public static $basePath = NULL;

Anyway, here's a patch applying that to some properties that were in an inconsistent state.

YesCT’s picture

I found it!

https://drupal.org/node/608152#naming

Methods and class properties should use lowerCamel naming.

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Yay, looks good! Committed to the module. You are getting to be on the credits of #1952394: Add configuration translation user interface module in core thanks to this :)

Gábor Hojtsy’s picture

@YesCT and I also tested if you missed anything with:

git grep --extended-regex 'this->[[:alnum:]]+_'

Did not find matches. :) Looks like all covered.

YesCT’s picture

All the property definitions that start with protected public private are all camel case. good.

Status: Fixed » Closed (fixed)

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