Repository: phpactor/phpactor (php)

Issue:
SignatureHelp returns empty response
For this document:

```php
<?php

namespace MarsIPM\Tests\Controller\Unit\IPMRounds;

use MarsIPM\Tests\Utils\ContainerHelperTrait;
use MarsIPM\Tests\Utils\ControllerHelperTrait;
use MarsIPM\Tests\Utils\DatabaseUtils;
use MarsIPM\Tests\Utils\ORMHelperTrait;
use MarsIPM\Tests\Utils\UserHelperTrait;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class RoundSingleIssueEditCloseTest extends WebTestCase
{
	use ControllerHelperTrait;
	use ORMHelperTrait;
	use UserHelperTrait;
	use ContainerHelperTrait;
	use ProphecyTrait;

	private KernelBrowser $client;

	public function setUp(): void
	{
		DatabaseUtils::resetDatabase();
		$this->client = static::createClient(<>);
	}
}
```
The request 
```
[Trace - 9:07:00 AM] Sending request 'textDocument/signatureHelp - (622)'.
Params: {
    "textDocument": {
        "uri": "file:///var/www/ct/app/tests/Controller/Unit/IPMRounds/RoundSingleIssueEditCloseTest.php"
    },
    "position": {
        "line": 26,
        "character": 39
    },
    "context": {
        "isRetrigger": false,
        "triggerKind": 1
    }
}
```
Returns:
```
[Trace - 9:07:00 AM] Received response 'textDocument/signatureHelp - (622)' in 9ms.
No result returned.
```

Pull request description:
Resolve static for signature help
Fixes #1755 

Patch:
diff --git a/lib/Completion/Bridge/TolerantParser/WorseReflection/WorseSignatureHelper.php b/lib/Completion/Bridge/TolerantParser/WorseReflection/WorseSignatureHelper.php
index e8f0381b..8f447891 100644
--- a/lib/Completion/Bridge/TolerantParser/WorseReflection/WorseSignatureHelper.php
+++ b/lib/Completion/Bridge/TolerantParser/WorseReflection/WorseSignatureHelper.php
@@ -192,8 +192,9 @@ class WorseSignatureHelper implements SignatureHelper
             throw new CouldNotHelpWithSignature(sprintf('Static calls only supported with qualified names'));
         }
 
-        $class = $scopeResolutionQualifier->getResolvedName();
-        $reflectionClass = $this->reflector->reflectClass((string) $class);
+        $offset = $this->reflector->reflectOffset($node->getFileContents(), $scopeResolutionQualifier->getStartPosition());
+
+        $reflectionClass = $this->reflector->reflectClass($offset->symbolContext()->type()->__toString());
 
         $memberName = $callable->memberName;
 


Test patch:
diff --git a/lib/Completion/Tests/Integration/Bridge/TolerantParser/WorseReflection/WorseSignatureHelperTest.php b/lib/Completion/Tests/Integration/Bridge/TolerantParser/WorseReflection/WorseSignatureHelperTest.php
index 94fcd1b8..80b37182 100644
--- a/lib/Completion/Tests/Integration/Bridge/TolerantParser/WorseReflection/WorseSignatureHelperTest.php
+++ b/lib/Completion/Tests/Integration/Bridge/TolerantParser/WorseReflection/WorseSignatureHelperTest.php
@@ -117,6 +117,16 @@ class WorseSignatureHelperTest extends IntegrationTestCase
                 0
             )
         ];
+        yield 'self method signature with no parameters inside another function' => [
+            '<?php function hello() {}; class Hi { public static function hi() public function f() { self::hi(<> }',
+            new SignatureHelp(
+                [new SignatureInformation(
+                    'pub hi()',
+                    []
+                )],
+                0
+            )
+        ];
 
         yield 'function with parameter' => [
             '<?php function hello(string $foo) {}; hello(<>',