-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid choose_handler error on PHP7.3. (#46)
- クラス書き換えがうまくいっていなかった部分で書き換えを行う
- Loading branch information
Showing
4 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Add patch for php-scoper. | ||
*/ | ||
|
||
foreach ( [ | ||
'vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php' => function ( string $content ) { | ||
return preg_replace( '/(GuzzleHttp.*ClientInterface::)(MAJOR_VERSION|VERSION)/u', 'GaCommunicatorVendor\\\\' . '$1$2', $content ); | ||
}, | ||
'vendor/guzzlehttp/guzzle/src/HandlerStack.php' => function ( string $content ) { | ||
return preg_replace( '/(\$handler \?: )(choose_handler\(\))/u', '$1\\GaCommunicatorVendor\\GuzzleHttp\\\\$2', $content ); | ||
}, | ||
] as $path => $callable ) { | ||
$path = dirname( __DIR__ ) . '/vendor-prefixed/' . ltrim( $path, '' ); | ||
if ( ! file_exists( $path ) ) { | ||
echo "File missing: {$path}" . PHP_EOL; | ||
continue; | ||
} | ||
$content = file_get_contents( $path ); | ||
file_put_contents( $path, $callable( $content ) ); | ||
echo "File Updated: {$path}" . PHP_EOL; | ||
} |
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