"file.");
break;
}
- } else if (count($classes) == 1) {
- foreach ($classes as $class) {
- $class_name = $class->getChildByIndex(1);
- $class_string = $class_name->getConcreteString();
- if ($file != $class_string.'.php') {
- $rename = $class_string.'.php';
- $requirements->addLint(
- $class_name,
- $class_string,
- ArcanistPhutilModuleLinter::LINT_ANALYZER_CLASS_FILENAME,
- "The name of this file differs from the name of the class it ".
- "declares. Rename the file to '{$rename}'.");
- }
- break;
- }
}
$uses_of_new = $root->selectDescendantsOfType('n_NEW');
const LINT_ANALYZER_DYNAMIC = 101;
const LINT_ANALYZER_NO_INIT = 102;
const LINT_ANALYZER_MULTIPLE_CLASSES = 103;
- const LINT_ANALYZER_CLASS_FILENAME = 104;
public function getLintNameMap() {
return array(
self::LINT_ANALYZER_NO_INIT => 'Analyzer: No __init__.php File',
self::LINT_ANALYZER_MULTIPLE_CLASSES
=> 'Analyzer: File Declares Multiple Classes',
- self::LINT_ANALYZER_CLASS_FILENAME
- => 'Analyzer: Filename Does Not Match Class Declaration',
);
}