Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Mar 2, 2020
1 parent ceebc9e commit 86d52bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
18 changes: 1 addition & 17 deletions src/Psalm/Internal/Codebase/Analyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ public function loadCachedResults(ProjectAnalyzer $project_analyzer)

$this->mixed_counts = $file_reference_provider->getTypeCoverage();

$classlikes = $codebase->classlikes;

foreach ($changed_members as $file_path => $members_by_file) {
foreach ($members_by_file as $changed_member => $_) {
if (!strpos($changed_member, '&')) {
Expand All @@ -622,7 +620,7 @@ public function loadCachedResults(ProjectAnalyzer $project_analyzer)

list($base_class, $trait) = explode('&', $changed_member);

foreach ($all_referencing_methods as $member_id => $referencing_method_ids) {
foreach ($all_referencing_methods as $member_id => $_) {
if (strpos($member_id, $base_class . '::') !== 0) {
continue;
}
Expand All @@ -636,20 +634,6 @@ public function loadCachedResults(ProjectAnalyzer $project_analyzer)
}
}

foreach ($all_referencing_methods as $member_id => $referencing_method_ids) {
if (!strpos($member_id, '&')) {
continue;
}

$member_stub = $member_class_name . '::*';

if (!isset($all_referencing_methods[$member_stub])) {
$all_referencing_methods[$member_stub] = $referencing_method_ids;
} else {
$all_referencing_methods[$member_stub] += $referencing_method_ids;
}
}

$newly_invalidated_methods = [];

foreach ($unchanged_signature_members as $file_unchanged_signature_members) {
Expand Down
10 changes: 0 additions & 10 deletions src/Psalm/Internal/Codebase/ClassLikes.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,6 @@ public function getMatchingClassLikeNames(string $stub) : array
return $matching_classes;
}

/**
* @param string $fq_class_name_lc
*
* @return bool
*/
public function hasFullyQualifiedClassLikeName($fq_class_name_lc)
{
return isset($this->existing_classlikes_lc[$fq_class_name_lc]);
}

/**
* @param string $fq_class_name
*
Expand Down
4 changes: 2 additions & 2 deletions src/Psalm/Internal/Diff/ClassStatementsDiffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function (
}
} elseif ($diff_elem->old instanceof PhpParser\Node\Stmt\TraitUse) {
foreach ($diff_elem->old->traits as $trait) {
$keep[] = strtolower($name . '&' . $trait->getAttribute('resolvedName'));
$keep[] = strtolower($name . '&' . (string) $trait->getAttribute('resolvedName'));
}
}
} elseif ($diff_elem->type === DiffElem::TYPE_KEEP_SIGNATURE) {
Expand All @@ -229,7 +229,7 @@ function (
}
} elseif ($affected_elem instanceof PhpParser\Node\Stmt\TraitUse) {
foreach ($affected_elem->traits as $trait) {
$add_or_delete[] = strtolower($name . '&' . $trait->getAttribute('resolvedName'));
$add_or_delete[] = strtolower($name . '&' . (string) $trait->getAttribute('resolvedName'));
}
}
}
Expand Down

0 comments on commit 86d52bb

Please sign in to comment.