Skip to content

Commit

Permalink
Fix ValueGenerator on PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan committed Oct 13, 2022
1 parent 8419f01 commit 8f4f195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
operating-system:
- "ubuntu-latest"

Expand Down
4 changes: 4 additions & 0 deletions src/ProxyManager/Generator/ValueGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function generate(): string

private static function fixExport(string $value): string
{
if (PHP_VERSION_ID >= 80200) {
return $value;
}

$parts = preg_split('{(\'(?:[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')}', $value, -1, PREG_SPLIT_DELIM_CAPTURE);

foreach ($parts as $i => &$part) {
Expand Down

0 comments on commit 8f4f195

Please sign in to comment.