Skip to content

Commit

Permalink
Merge pull request #9336 from edsrzf/ls-closure-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Feb 19, 2023
2 parents 5fe902b + d4a57c8 commit 075e97a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
Expand Up @@ -471,6 +471,7 @@ private static function handleNamedFunction(
= $function_call_info->is_stubbed || $function_call_info->in_call_map || $namespaced_function_exists;

if ($function_call_info->function_exists
&& !$stmt->isFirstClassCallable()
&& $codebase->store_node_types
&& !$context->collect_initializations
&& !$context->collect_mutations
Expand Down
Expand Up @@ -95,6 +95,7 @@ public static function analyze(
}

if ($codebase->store_node_types
&& !$stmt->isFirstClassCallable()
&& !$context->collect_initializations
&& !$context->collect_mutations
) {
Expand Down Expand Up @@ -226,6 +227,7 @@ public static function analyze(
}

if ($codebase->store_node_types
&& !$stmt->isFirstClassCallable()
&& !$context->collect_initializations
&& !$context->collect_mutations
) {
Expand Down
Expand Up @@ -322,6 +322,7 @@ private static function handleNamedCall(
$cased_method_id = $fq_class_name . '::' . $stmt_name->name;

if ($codebase->store_node_types
&& !$stmt->isFirstClassCallable()
&& !$context->collect_initializations
&& !$context->collect_mutations
) {
Expand Down
1 change: 1 addition & 0 deletions tests/Traits/InvalidCodeAnalysisTestTrait.php
Expand Up @@ -73,6 +73,7 @@ public function testInvalidCode(
$this->expectExceptionMessageMatches('/\b' . preg_quote($error_message, '/') . '\b/');

$codebase = $this->project_analyzer->getCodebase();
$codebase->enterServerMode();
$codebase->config->visitPreloadedStubFiles($codebase);

$this->addFile($file_path, $code);
Expand Down
1 change: 1 addition & 0 deletions tests/Traits/ValidCodeAnalysisTestTrait.php
Expand Up @@ -68,6 +68,7 @@ public function testValidCode(
$this->project_analyzer->setPhpVersion($php_version, 'tests');

$codebase = $this->project_analyzer->getCodebase();
$codebase->enterServerMode();
$codebase->config->visitPreloadedStubFiles($codebase);

$file_path = self::$src_dir_path . 'somefile.php';
Expand Down

0 comments on commit 075e97a

Please sign in to comment.