Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix variable sniff for schema classes.

Schema classes can use whatever conventions they like.
Most tables are under_scored so don't force them to be
anything else.
  • Loading branch information...
commit 1acce8e471c52fa952e954a2e839efa6c412f684 1 parent 806d7b4
@markstory authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 Sniffs/NamingConventions/ValidVariableNameSniff.php
View
8 Sniffs/NamingConventions/ValidVariableNameSniff.php
@@ -163,6 +163,14 @@ protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}
}
+ $conditions = array_keys($tokens[$stackPtr]['conditions']);
+ $className = $phpcsFile->getDeclarationName($conditions[0]);
+
+ // Schema properties are allowed to not be CamelCase.
+ if (substr($className, -6) === 'Schema') {
+ return;
+ }
+
if ($this->_isValidVar($varName, $public) === false) {
$error = 'Member variable "%s" is not in valid camel caps format';
$data = array($varName);
Please sign in to comment.
Something went wrong with that request. Please try again.