The DB layer uses lowerCamelCase, other places (many tests) use under_scores. lowerCamelCase seems the way to go.

Class variables that follow the under_score convention need to be converted to lowerCamelCase.

There is an issue for improving OO coding styles documentation #260220: OOP standards.

CommentFileSizeAuthor
#1 451934-classNames.patch9.06 KBagentrickard

Comments

agentrickard’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Needs review
Issue tags: +DBTNG
StatusFileSize
new9.06 KB

Here's a patch that standardizes.

Let's not bikeshed this, but rather approve the change or drop the issue.

Status: Needs review » Needs work

The last submitted patch, 451934-classNames.patch, failed testing.

kathyh’s picture

When testing the patch - the $driver variable is declared fairly deep and cat'ed to create the classname. For example:

includes\database\database.inc :
Line 1661: $driver_class = 'DatabaseConnection_' . $driver;

The case would need to be enforced or applied to the DB driver specified.

For reference the following are the names defined in the patch:

  • DatabaseConnectionMySQL , DatabaseConnectionPgSQL ,DatabaseConnectionSQLite
  • DatabaseSchemaMySQL ,DatabaseSchemaPgSQL ,DatabaseSchemaSQLite
  • DatabaseStatementSQLite
  • DatabaseTasksMySQL ,DatabaseTasksPgSQL mDatabaseTasksSQLite
  • DeleteQuerySQLite
  • InsertQueryMySQL , InsertQueryPgSQL ,InsertQuerySQLite
  • SelectQueryPgSQL mSelectQuerySQLite
  • TruncateQueryMySQL mTruncateQuerySQLite
  • UpdateQueryPgSQL , UpdateQuerySQLite

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

scythian’s picture

Issue summary: View changes
Status: Needs work » Needs review

Looks like deprecated issue. Source were changed repeatedly and now most classes looks fine and using lowerCamelCase instead of under_score.

klausi’s picture

Status: Needs review » Closed (outdated)

Yes.