composer update
This commit is contained in:
@@ -26,7 +26,7 @@ class EmulativeTest extends LexerTest
|
||||
/**
|
||||
* @dataProvider provideTestReplaceKeywords
|
||||
*/
|
||||
public function testNoReplaceKeywordsAfterObjectOperator($keyword) {
|
||||
public function testNoReplaceKeywordsAfterObjectOperator(string $keyword) {
|
||||
$lexer = $this->getLexer();
|
||||
$lexer->startLexing('<?php ->' . $keyword);
|
||||
|
||||
@@ -35,8 +35,23 @@ class EmulativeTest extends LexerTest
|
||||
$this->assertSame(0, $lexer->getNextToken());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideTestReplaceKeywords
|
||||
*/
|
||||
public function testNoReplaceKeywordsAfterObjectOperatorWithSpaces(string $keyword) {
|
||||
$lexer = $this->getLexer();
|
||||
$lexer->startLexing('<?php -> ' . $keyword);
|
||||
|
||||
$this->assertSame(Tokens::T_OBJECT_OPERATOR, $lexer->getNextToken());
|
||||
$this->assertSame(Tokens::T_STRING, $lexer->getNextToken());
|
||||
$this->assertSame(0, $lexer->getNextToken());
|
||||
}
|
||||
|
||||
public function provideTestReplaceKeywords() {
|
||||
return [
|
||||
// PHP 7.4
|
||||
['fn', Tokens::T_FN],
|
||||
|
||||
// PHP 5.5
|
||||
['finally', Tokens::T_FINALLY],
|
||||
['yield', Tokens::T_YIELD],
|
||||
@@ -88,7 +103,7 @@ class EmulativeTest extends LexerTest
|
||||
*/
|
||||
public function testErrorAfterEmulation($code) {
|
||||
$errorHandler = new ErrorHandler\Collecting;
|
||||
$lexer = $this->getLexer([]);
|
||||
$lexer = $this->getLexer();
|
||||
$lexer->startLexing('<?php ' . $code . "\0", $errorHandler);
|
||||
|
||||
$errors = $errorHandler->getErrors();
|
||||
|
||||
@@ -53,6 +53,7 @@ class NodeDumperTest extends \PHPUnit\Framework\TestCase
|
||||
value: Foo
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)'
|
||||
|
||||
@@ -212,8 +212,8 @@ interface A extends C, D {
|
||||
public function a(A $a) : A;
|
||||
}
|
||||
|
||||
function fn(A $a) : A {}
|
||||
function fn2(array $a) : array {}
|
||||
function f(A $a) : A {}
|
||||
function f2(array $a) : array {}
|
||||
function(A $a) : A {};
|
||||
|
||||
function fn3(?A $a) : ?A {}
|
||||
@@ -249,10 +249,10 @@ interface A extends \NS\C, \NS\D
|
||||
{
|
||||
public function a(\NS\A $a) : \NS\A;
|
||||
}
|
||||
function fn(\NS\A $a) : \NS\A
|
||||
function f(\NS\A $a) : \NS\A
|
||||
{
|
||||
}
|
||||
function fn2(array $a) : array
|
||||
function f2(array $a) : array
|
||||
{
|
||||
}
|
||||
function (\NS\A $a) : \NS\A {
|
||||
|
||||
Reference in New Issue
Block a user