Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial php 8.4 compatibility #2714

Merged
merged 12 commits into from
Dec 9, 2024
8 changes: 4 additions & 4 deletions bin/GoogleAdsCleanupServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GoogleAdsCleanupServices {
* @param Event|null $event Composer event.
* @param string|null $path Path of the Ads library.
*/
public function __construct( Event $event = null, string $path = null ) {
public function __construct( ?Event $event = null, ?string $path = null ) {
puntope marked this conversation as resolved.
Show resolved Hide resolved
$this->event = $event;
$this->path = $path ?: dirname( __DIR__ ) . '/vendor/googleads/google-ads-php';
$this->code_path = dirname( __DIR__ ) . '/src';
Expand All @@ -70,9 +70,9 @@ public function __construct( Event $event = null, string $path = null ) {
/**
* Remove unused classes from the library.
*
* @param Event $event Event context provided by Composer
* @param Event|null $event Event context provided by Composer
*/
public static function remove( Event $event = null ) {
public static function remove( ?Event $event = null ) {
$cleanup = new GoogleAdsCleanupServices( $event );
$cleanup->remove_services();
$cleanup->remove_enums();
Expand Down Expand Up @@ -263,7 +263,7 @@ protected function find_used_pattern( string $pattern ): array {
*
* @return array List of matched names.
*/
protected function find_library_file_pattern( string $pattern, string $suffix = null ): array {
protected function find_library_file_pattern( string $pattern, ?string $suffix = null ): array {
$output = glob( "{$pattern}/*.php" );

if ( empty( $output ) ) {
Expand Down
6 changes: 3 additions & 3 deletions bin/SymfonyPolyfillCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SymfonyPolyfillCleanup {
* @param Event|null $event Composer event.
* @param string|null $path Path of the Symfony library.
*/
public function __construct( Event $event = null, string $path = null ) {
public function __construct( ?Event $event = null, ?string $path = null ) {
$this->event = $event;
$this->path = $path ?: dirname( __DIR__ ) . '/vendor/symfony/';
}
Expand All @@ -62,9 +62,9 @@ protected function get_list_of_polyfills(): array {
/**
* Remove PHP 8.0 specific code of Symfony polyfills
*
* @param Event $event Event context provided by Composer
* @param Event|null $event Event context provided by Composer
*/
public static function remove( Event $event = null ) {
public static function remove( ?Event $event = null ) {
$cleanup = new SymfonyPolyfillCleanup( $event );
$cleanup->remove_bootstraps80();
}
Expand Down
3 changes: 1 addition & 2 deletions bin/prefix-vendor-namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@
'GuzzleHttp\ClientInterface::VERSION',
'GuzzleHttp\describe_type',
'GuzzleHttp\HandlerStack::create',
'GuzzleHttp\Message\ResponseInterface)',
'GuzzleHttp\Psr7\Message::bodySummary',
'GuzzleHttp\Psr7\Utils::streamFor',
'GuzzleHttp\Psr7\Utils::tryFopen',
'GuzzleHttp\Psr7\Utils::redactUserInfo',
],
];

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"google/apiclient": "^2.16",
"google/apiclient-services": "^0.350.0",
"googleads/google-ads-php": "dev-legacy-v22.1.0",
"league/container": "^3.4",
"league/container": "^4.2",
"league/iso3166": "^4.1",
"phpseclib/bcmath_compat": "^2.0",
"psr/container": "^1.1",
Expand Down
Loading
Loading