1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Remove dead code and fix config.xsd

This commit is contained in:
Matt Brown 2017-02-07 18:27:28 -05:00
parent f4857eb0dd
commit 34980fc718
5 changed files with 11 additions and 6 deletions

View File

@ -84,6 +84,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="AbstractInstantiation" type="IssueHandlerType" minOccurs="0" />
<xs:element name="ContinueOutsideLoop" type="IssueHandlerType" minOccurs="0" />
<xs:element name="DeadCode" type="IssueHandlerType" minOccurs="0" />
<xs:element name="DeprecatedMethod" type="IssueHandlerType" minOccurs="0" />
<xs:element name="DuplicateParam" type="IssueHandlerType" minOccurs="0" />
<xs:element name="DuplicateClass" type="IssueHandlerType" minOccurs="0" />

View File

@ -20,6 +20,12 @@
<NullOperand errorLevel="suppress" />
<MissingConstructor errorLevel="suppress" />
<DeadCode>
<errorLevel type="suppress">
<directory name="tests" />
</errorLevel>
</DeadCode>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<directory name="tests" />

View File

@ -253,7 +253,7 @@ class FileChecker extends SourceChecker implements StatementsSource
$this->interface_checkers_to_visit[$fq_class_name] = $class_checker;
} elseif ($stmt instanceof PhpParser\Node\Stmt\Trait_) {
$trait_checker = new TraitChecker($stmt, $this, $stmt->name);
new TraitChecker($stmt, $this, $stmt->name);
}
} elseif ($stmt instanceof PhpParser\Node\Stmt\Namespace_) {
$namespace_name = $stmt->name ? implode('\\', $stmt->name->parts) : '';
@ -1014,8 +1014,6 @@ class FileChecker extends SourceChecker implements StatementsSource
$function_line = $file_lines[$line_number - 1];
$left_padding = str_replace(ltrim($function_line), '', $function_line);
$line_before = $file_lines[$line_number - 2];
$parsed_docblock = [];
$existing_line_count = $existing_docblock ? substr_count($existing_docblock, PHP_EOL) + 1 : 0;

View File

@ -451,7 +451,7 @@ class Config
*/
public function initializePlugins(ProjectChecker $project_checker)
{
foreach ($this->filetype_handlers as $extension_name => &$path) {
foreach ($this->filetype_handlers as &$path) {
$plugin_file_checker = new FileChecker($path, $project_checker);
$plugin_file_checker->visit();

View File

@ -85,7 +85,7 @@ class Union
)
);
}
/**
* @return void
*/
@ -251,7 +251,7 @@ class Union
public function removeObjects()
{
foreach ($this->types as $key => $type) {
if ($key[0] === strtoupper($key[0])) {
if ($type instanceof Atomic\TNamedObject) {
unset($this->types[$key]);
}
}