mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Reduce memory footprint a little
This commit is contained in:
parent
8404fa0750
commit
bcd7478352
@ -1786,8 +1786,6 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
||||
|
||||
$type_provider = new \Psalm\Internal\Provider\NodeDataProvider();
|
||||
|
||||
$time = \microtime(true);
|
||||
|
||||
$method_analyzer->analyze(
|
||||
$method_context,
|
||||
$type_provider,
|
||||
@ -1812,11 +1810,6 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
||||
);
|
||||
}
|
||||
|
||||
$project_analyzer->progress->debug(
|
||||
'Analyzing method ' . $stmt->name . ' took '
|
||||
. \number_format(\microtime(true) - $time, 4) . "seconds \n"
|
||||
);
|
||||
|
||||
if (!$method_already_analyzed
|
||||
&& !$class_context->collect_initializations
|
||||
&& !$class_context->collect_mutations
|
||||
|
@ -76,8 +76,8 @@ class Taint
|
||||
Taintable $from,
|
||||
Taintable $to,
|
||||
string $path_type,
|
||||
array $added_taints = [],
|
||||
array $removed_taints = []
|
||||
?array $added_taints = null,
|
||||
?array $removed_taints = null
|
||||
) : void {
|
||||
$from_id = $from->id;
|
||||
$to_id = $to->id;
|
||||
@ -209,8 +209,8 @@ class Taint
|
||||
|
||||
foreach ($this->forward_edges[$generated_source->id] as $to_id => $path) {
|
||||
$path_type = $path->type;
|
||||
$added_taints = $path->unescaped_taints;
|
||||
$removed_taints = $path->escaped_taints;
|
||||
$added_taints = $path->unescaped_taints ?: [];
|
||||
$removed_taints = $path->escaped_taints ?: [];
|
||||
|
||||
if (!isset($this->nodes[$to_id])) {
|
||||
continue;
|
||||
|
@ -11,10 +11,10 @@ class Path
|
||||
public $escaped_taints;
|
||||
|
||||
/**
|
||||
* @param array<string> $unescaped_taints
|
||||
* @param array<string> $escaped_taints
|
||||
* @param ?array<string> $unescaped_taints
|
||||
* @param ?array<string> $escaped_taints
|
||||
*/
|
||||
public function __construct(string $type, array $unescaped_taints, array $escaped_taints)
|
||||
public function __construct(string $type, ?array $unescaped_taints, ?array $escaped_taints)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->unescaped_taints = $unescaped_taints;
|
||||
|
@ -325,14 +325,11 @@ class Reconciler
|
||||
}
|
||||
|
||||
if ($before_adjustment
|
||||
&& ($result_type->parent_nodes || $before_adjustment->parent_nodes)
|
||||
&& $before_adjustment->parent_nodes
|
||||
&& !$result_type->isInt()
|
||||
&& !$result_type->isFloat()
|
||||
) {
|
||||
$result_type->parent_nodes = array_merge(
|
||||
$result_type->parent_nodes ?: [],
|
||||
$before_adjustment->parent_nodes ?: []
|
||||
);
|
||||
$result_type->parent_nodes = $before_adjustment->parent_nodes;
|
||||
}
|
||||
|
||||
$type_changed = !$before_adjustment || !$result_type->equals($before_adjustment);
|
||||
|
Loading…
x
Reference in New Issue
Block a user