-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from goaop/bug/functional-weaving-complex-type
[PHP8] Add broken tests with complex types
- Loading branch information
Showing
13 changed files
with
861 additions
and
35 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
27 changes: 27 additions & 0 deletions
27
tests/Fixtures/project/src/Application/ClassWithComplexTypes.php
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,27 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace Go\Tests\TestProject\Application; | ||
|
||
use Closure; | ||
use Countable; | ||
use Exception; | ||
use Iterator; | ||
|
||
class ClassWithComplexTypes | ||
{ | ||
public function publicMethodWithUnionTypeReturn(Exception|Closure $value): Exception|Closure | ||
{ | ||
return $value; | ||
} | ||
|
||
public function publicMethodWithIntersectionTypeReturn(Exception&Countable $value): Exception&Countable | ||
{ | ||
return $value; | ||
} | ||
|
||
public function publicMethodWithDNFTypeReturn(Iterator|(Exception&Countable) $value): Iterator|(Exception&Countable) | ||
{ | ||
return $value; | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
tests/Go/Instrument/Transformer/_files/anonymous-class-transformed.php
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,27 @@ | ||
<?php | ||
/** | ||
* Parser Reflection API | ||
* | ||
* @copyright Copyright 2016, Lisachenko Alexander <[email protected]> | ||
* | ||
* This source file is subject to the license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Go\ParserReflection\Stub; | ||
|
||
class InAnonymousClass | ||
{ | ||
public function respond() | ||
{ | ||
new class { | ||
public const FOO = 'foo'; | ||
|
||
public function run() | ||
{ | ||
return self::FOO; | ||
} | ||
}; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/Go/Instrument/Transformer/_files/anonymous-class.php
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,27 @@ | ||
<?php | ||
/** | ||
* Parser Reflection API | ||
* | ||
* @copyright Copyright 2016, Lisachenko Alexander <[email protected]> | ||
* | ||
* This source file is subject to the license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Go\ParserReflection\Stub; | ||
|
||
class InAnonymousClass | ||
{ | ||
public function respond() | ||
{ | ||
new class { | ||
public const FOO = 'foo'; | ||
|
||
public function run() | ||
{ | ||
return self::FOO; | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.