Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Aug 31, 2023
1 parent de40978 commit 3067615
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2426,9 +2426,7 @@ public function visitComposerAutoloadFiles(ProjectAnalyzer $project_analyzer, ?P
// as they might be autoloadable once we require the autoloader below
$codebase->classlikes->forgetMissingClassLikes();

$this->include_collector->runAndCollect(
[$this, 'requireAutoloader'],
);
$this->include_collector->runAndCollect($this->requireAutoloader(...));
}

$this->collectPredefinedConstants();
Expand Down
5 changes: 1 addition & 4 deletions src/Psalm/Internal/Codebase/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private function scanFilePaths(): bool
{
$files_to_scan = array_filter(
$this->files_to_scan,
[$this, 'shouldScan'],
$this->shouldScan(...),
);

$this->files_to_scan = [];
Expand All @@ -316,9 +316,6 @@ private function scanFilePaths(): bool
if ($pool_size > 1) {
$this->progress->debug('Forking process for scanning' . PHP_EOL);


// Run scanning one file at a time, splitting the set of
// files up among a given number of child processes.
$forked_pool_data = ProjectAnalyzer::getInstance()->pool->run(
$files_to_scan,
new InitScannerTask(),
Expand Down
7 changes: 1 addition & 6 deletions src/Psalm/Internal/Codebase/TaintFlowGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -521,12 +521,7 @@ private function getSpecializedSources(DataFlowNode $source): array

return array_filter(
$generated_sources,
[$this, 'doesForwardEdgeExist'],
fn ($new_source) => isset($this->forward_edges[$new_source->id])
);
}

private function doesForwardEdgeExist(DataFlowNode $new_source): bool
{
return isset($this->forward_edges[$new_source->id]);
}
}
2 changes: 1 addition & 1 deletion src/Psalm/Report/CodeClimateReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function create(): string
$options = $this->pretty ? Json::PRETTY : Json::DEFAULT;

$issues_data = array_map(
[$this, 'mapToNewStructure'],
$this->mapToNewStructure(...),
$this->issues_data,
);

Expand Down

0 comments on commit 3067615

Please sign in to comment.