Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gh 2588 false not bool and show project + runtime php versions in LSP…
… status (#2591) * Add passing test for false type * Show PHP version and source in status * Fix test case name * GH-2588: Do not generalize types for return and PHP version in status * Update CL
- Loading branch information
Showing
14 changed files
with
167 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
interface PhpVersionResolver | ||
{ | ||
public function resolve(): ?string; | ||
public function name(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Phpactor\Extension\Php\Status; | ||
|
||
use Phpactor\Extension\LanguageServer\Status\StatusProvider; | ||
use Phpactor\Extension\Php\Model\ChainResolver; | ||
|
||
class PhpStatusProvider implements StatusProvider | ||
{ | ||
public function __construct( | ||
private ChainResolver $chainResolver, | ||
) { | ||
} | ||
|
||
public function title(): string | ||
{ | ||
return 'php'; | ||
} | ||
|
||
public function provide(): array | ||
{ | ||
return [ | ||
'project' => (string)$this->chainResolver->resolve(), | ||
'source' => $this->chainResolver->source(), | ||
'runtime' => phpversion(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Foo; | ||
|
||
wrAssertType('string|false', possiblyFalse()); | ||
|
||
function possiblyFalse(array $foo): string|false | ||
{ | ||
} | ||
|
||
/** | ||
* @return string|false a formatted date string. If a non-numeric value is used for | ||
*/ | ||
function date() | ||
{ | ||
} | ||
|
||
wrAssertType('string|false', date()); |