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:
parent
f4857eb0dd
commit
34980fc718
@ -84,6 +84,7 @@
|
|||||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||||
<xs:element name="AbstractInstantiation" type="IssueHandlerType" minOccurs="0" />
|
<xs:element name="AbstractInstantiation" type="IssueHandlerType" minOccurs="0" />
|
||||||
<xs:element name="ContinueOutsideLoop" 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="DeprecatedMethod" type="IssueHandlerType" minOccurs="0" />
|
||||||
<xs:element name="DuplicateParam" type="IssueHandlerType" minOccurs="0" />
|
<xs:element name="DuplicateParam" type="IssueHandlerType" minOccurs="0" />
|
||||||
<xs:element name="DuplicateClass" type="IssueHandlerType" minOccurs="0" />
|
<xs:element name="DuplicateClass" type="IssueHandlerType" minOccurs="0" />
|
||||||
|
@ -20,6 +20,12 @@
|
|||||||
<NullOperand errorLevel="suppress" />
|
<NullOperand errorLevel="suppress" />
|
||||||
<MissingConstructor errorLevel="suppress" />
|
<MissingConstructor errorLevel="suppress" />
|
||||||
|
|
||||||
|
<DeadCode>
|
||||||
|
<errorLevel type="suppress">
|
||||||
|
<directory name="tests" />
|
||||||
|
</errorLevel>
|
||||||
|
</DeadCode>
|
||||||
|
|
||||||
<PropertyNotSetInConstructor>
|
<PropertyNotSetInConstructor>
|
||||||
<errorLevel type="suppress">
|
<errorLevel type="suppress">
|
||||||
<directory name="tests" />
|
<directory name="tests" />
|
||||||
|
@ -253,7 +253,7 @@ class FileChecker extends SourceChecker implements StatementsSource
|
|||||||
|
|
||||||
$this->interface_checkers_to_visit[$fq_class_name] = $class_checker;
|
$this->interface_checkers_to_visit[$fq_class_name] = $class_checker;
|
||||||
} elseif ($stmt instanceof PhpParser\Node\Stmt\Trait_) {
|
} 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_) {
|
} elseif ($stmt instanceof PhpParser\Node\Stmt\Namespace_) {
|
||||||
$namespace_name = $stmt->name ? implode('\\', $stmt->name->parts) : '';
|
$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];
|
$function_line = $file_lines[$line_number - 1];
|
||||||
$left_padding = str_replace(ltrim($function_line), '', $function_line);
|
$left_padding = str_replace(ltrim($function_line), '', $function_line);
|
||||||
|
|
||||||
$line_before = $file_lines[$line_number - 2];
|
|
||||||
|
|
||||||
$parsed_docblock = [];
|
$parsed_docblock = [];
|
||||||
$existing_line_count = $existing_docblock ? substr_count($existing_docblock, PHP_EOL) + 1 : 0;
|
$existing_line_count = $existing_docblock ? substr_count($existing_docblock, PHP_EOL) + 1 : 0;
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ class Config
|
|||||||
*/
|
*/
|
||||||
public function initializePlugins(ProjectChecker $project_checker)
|
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 = new FileChecker($path, $project_checker);
|
||||||
$plugin_file_checker->visit();
|
$plugin_file_checker->visit();
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ class Union
|
|||||||
public function removeObjects()
|
public function removeObjects()
|
||||||
{
|
{
|
||||||
foreach ($this->types as $key => $type) {
|
foreach ($this->types as $key => $type) {
|
||||||
if ($key[0] === strtoupper($key[0])) {
|
if ($type instanceof Atomic\TNamedObject) {
|
||||||
unset($this->types[$key]);
|
unset($this->types[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user