Permalink
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...
1 parent 806d7b4 commit 1acce8e471c52fa952e954a2e839efa6c412f684 @markstory committed May 9, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 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);

0 comments on commit 1acce8e

Please sign in to comment.