Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the problem with using named parameters and antonymous classes …
…in class located by a tokenizer. (#895)
- Loading branch information
1 parent
e0e4c3c
commit 2e00249
Showing
6 changed files
with
134 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\Tests\Tokenizer\Classes; | ||
|
||
class ClassWithAnonymousClass | ||
{ | ||
public function __construct() | ||
{ | ||
$class = new class ('foo', 'bar') { | ||
private function someFunc(): void | ||
{ | ||
} | ||
}; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\Tests\Tokenizer\Classes; | ||
|
||
define('FOO', 'bar'); | ||
|
||
class ClassWithHeredoc | ||
{ | ||
public function __construct() | ||
{ | ||
<<<class | ||
FooBar | ||
class; | ||
<<<class | ||
class FooBar | ||
{ | ||
} | ||
class;FOO; | ||
<<<'class' | ||
class FooBar | ||
{ | ||
} | ||
class ;FOO; | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\Tests\Tokenizer\Classes; | ||
|
||
use Spiral\Tests\Tokenizer\Classes\Inner\ClassD; | ||
|
||
class ClassWithNamedParameter | ||
{ | ||
public function __construct() | ||
{ | ||
$this->foo(class: ClassD::class); | ||
} | ||
|
||
private function foo(string $class): void | ||
{ | ||
} | ||
} |
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