Skip to content
Permalink
Browse files

Fix errors

  • Loading branch information...
muglug committed Aug 6, 2019
1 parent 14b37b9 commit 16a1dc853808f849bb9dee1e130a1815f8618151
@@ -999,7 +999,7 @@ function (Assertion $assertion) use ($found_generic_params) : Assertion {
$method_id
. '-' . $code_location->file_name
. ':' . $code_location->raw_file_start
),
),
new CodeLocation($source, $stmt->name)
);
} else {
@@ -154,19 +154,23 @@ public function addSources(
*/
public function getPredecessorPath(TypeSource $source, array $visited_paths = []) : string
{
$location_summary = $source->code_location->getQuickSummary();
$location_summary = '';
if (isset($visited_paths[$location_summary])) {
return '';
}
if ($source->code_location) {
$location_summary = $source->code_location->getQuickSummary();
$visited_paths[$location_summary] = true;
if (isset($visited_paths[$location_summary])) {
return '';
}
$source_descriptor = $source->id . ($source->code_location ? ' (' . $location_summary . ')' : '');
$visited_paths[$location_summary] = true;
}
$source_descriptor = $source->id . ($location_summary ? ' (' . $location_summary . ')' : '');
if ($previous_source = $this->new_sources[$source->id] ?? self::$archived_sources[$source->id] ?? null) {
if ($previous_source === $source) {
throw new \UnexpectedValueException('bad');
return '';
}
return $this->getPredecessorPath($previous_source, $visited_paths) . ' -> ' . $source_descriptor;
@@ -180,17 +184,25 @@ public function getPredecessorPath(TypeSource $source, array $visited_paths = []
*/
public function getSuccessorPath(TypeSource $source, array $visited_paths = []) : string
{
$location_summary = $source->code_location->getQuickSummary();
$location_summary = '';
if (isset($visited_paths[$location_summary])) {
return '';
}
if ($source->code_location) {
$location_summary = $source->code_location->getQuickSummary();
$visited_paths[$location_summary] = true;
if (isset($visited_paths[$location_summary])) {
return '';
}
$visited_paths[$location_summary] = true;
}
$source_descriptor = $source->id . ($source->code_location ? ' (' . $location_summary . ')' : '');
$source_descriptor = $source->id . ($location_summary ? ' (' . $location_summary . ')' : '');
if ($next_source = $this->new_sinks[$source->id] ?? self::$archived_sinks[$source->id] ?? null) {
if ($next_source === $source) {
return '';
}
return $source_descriptor . ' -> ' . $this->getSuccessorPath($next_source, $visited_paths);
}

0 comments on commit 16a1dc8

Please sign in to comment.
You can’t perform that action at this time.