Skip to content

Commit a431aef

Browse files
fix: support PHP 8 (#15)
1 parent 6ba15df commit a431aef

9 files changed

+24
-6
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ language: php
33
php:
44
- '7.0'
55
- '7.3'
6+
- '7.4'
7+
- nightly
68

79
env:
810
global:

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.0"
18+
"php": ">=7.0"
1919
},
2020
"require-dev": {
21-
"phpunit/phpunit": "^6.3",
2221
"phpstan/phpstan": "*",
2322
"squizlabs/php_codesniffer": "^3.1"
2423
},

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
parameters:
2+
reportUnmatchedIgnoredErrors: false
23
ignoreErrors:
34
- '#Property .* does not accept#'

src/CodeLens.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class CodeLens
3333
*/
3434
public $data;
3535

36+
/**
37+
* @param mixed $data
38+
*/
3639
public function __construct(Range $range = null, Command $command = null, $data = null)
3740
{
3841
$this->range = $range;

src/Command.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class Command
1111
/**
1212
* Title of the command, like `save`.
1313
*
14-
* @var string
14+
* @var string|null
1515
*/
1616
public $title;
1717

1818
/**
1919
* The identifier of the actual command handler.
2020
*
21-
* @var string
21+
* @var string|null
2222
*/
2323
public $command;
2424

@@ -30,6 +30,9 @@ class Command
3030
*/
3131
public $arguments;
3232

33+
/**
34+
* @param mixed[]|null $arguments
35+
*/
3336
public function __construct(string $title = null, string $command = null, array $arguments = null)
3437
{
3538
$this->title = $title;

src/CompletionItemKind.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ public static function fromSymbolKind(int $kind): int
5252
return self::MODULE;
5353
case SymbolKind::FILE:
5454
return self::FILE;
55-
case SymbolKind::STRING:
56-
return self::TEXT;
5755
case SymbolKind::NUMBER:
5856
case SymbolKind::BOOLEAN:
5957
case SymbolKind::ARRAY:
@@ -65,6 +63,9 @@ public static function fromSymbolKind(int $kind): int
6563
case SymbolKind::VARIABLE:
6664
case SymbolKind::CONSTANT:
6765
return self::VARIABLE;
66+
case SymbolKind::STRING:
67+
default:
68+
return self::TEXT;
6869
}
6970
}
7071
}

src/CompletionOptions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class CompletionOptions
2222
*/
2323
public $triggerCharacters;
2424

25+
/**
26+
* @param string[]|null $triggerCharacters
27+
*/
2528
public function __construct(bool $resolveProvider = null, array $triggerCharacters = null)
2629
{
2730
$this->resolveProvider = $resolveProvider;

src/DocumentOnTypeFormattingOptions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class DocumentOnTypeFormattingOptions
2121
*/
2222
public $moreTriggerCharacter;
2323

24+
/**
25+
* @param string[]|null $moreTriggerCharacter
26+
*/
2427
public function __construct(string $firstTriggerCharacter = null, array $moreTriggerCharacter = null)
2528
{
2629
$this->firstTriggerCharacter = $firstTriggerCharacter;

src/SignatureHelpOptions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class SignatureHelpOptions
1414
*/
1515
public $triggerCharacters;
1616

17+
/**
18+
* @param string[]|null $triggerCharacters
19+
*/
1720
public function __construct(array $triggerCharacters = null)
1821
{
1922
$this->triggerCharacters = $triggerCharacters;

0 commit comments

Comments
 (0)