Skip to content

Commit e02276a

Browse files
authored
Merge pull request #10614 from weirdan/fix-json-mapping-with-opcache.save_comments-0
2 parents f045730 + 98756ba commit e02276a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Psalm/Internal/Fork/PsalmRestarter.php

+9
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ protected function requiresRestart($default): bool
8484
}
8585
}
8686

87+
// opcache.save_comments is required for json mapper (used in language server) to work
88+
if ($opcache_loaded && in_array(ini_get('opcache.save_comments'), ['0', 'false', 0, false])) {
89+
return true;
90+
}
91+
8792
return $default || $this->required;
8893
}
8994

@@ -152,6 +157,10 @@ protected function restart($command): void
152157
];
153158
}
154159

160+
if ($opcache_loaded) {
161+
$additional_options[] = '-dopcache.save_comments=1';
162+
}
163+
155164
array_splice(
156165
$command,
157166
1,

0 commit comments

Comments
 (0)