From 0d6fe10aae2991e7e654ba06a96f55aad8eab23b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:55:58 -0800 Subject: [PATCH] fix: Add compatibility for PHP 8.4 (#7905) * docs: correct SearchVehiclesRequest.ordered_by description PiperOrigin-RevId: 704403622 Source-Link: https://github.com/googleapis/googleapis/commit/4e78e682efabbe91a3bc62d3ce0213f02524929d Source-Link: https://github.com/googleapis/googleapis-gen/commit/157433126b3c6546254d9f8c3785b0af19b9d7bc Copy-Tag: eyJwIjoiTWFwc0ZsZWV0RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiIxNTc0MzMxMjZiM2M2NTQ2MjU0ZDlmOGMzNzg1YjBhZjE5YjlkN2JjIn0= * fix: Add compatibility for PHP 8.4 docs: Add documentation for logger client option PiperOrigin-RevId: 704769822 Source-Link: https://github.com/googleapis/googleapis/commit/68e77625374a91c46fe47980209fedd108c756e8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/724f6fc2efd4597d2e1c14709a0686ae070280ea Copy-Tag: eyJwIjoiTWFwc0ZsZWV0RW5naW5lLy5Pd2xCb3QueWFtbCIsImgiOiI3MjRmNmZjMmVmZDQ1OTdkMmUxYzE0NzA5YTA2ODZhZTA3MDI4MGVhIn0= --- .../src/V1/Client/TripServiceClient.php | 10 ++++-- .../src/V1/Client/VehicleServiceClient.php | 10 ++++-- MapsFleetEngine/src/V1/VehicleMatch.php | 36 +++++++++---------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/MapsFleetEngine/src/V1/Client/TripServiceClient.php b/MapsFleetEngine/src/V1/Client/TripServiceClient.php index 07c1f7f6c070..083cc27fd064 100644 --- a/MapsFleetEngine/src/V1/Client/TripServiceClient.php +++ b/MapsFleetEngine/src/V1/Client/TripServiceClient.php @@ -40,6 +40,7 @@ use Google\Maps\FleetEngine\V1\Trip; use Google\Maps\FleetEngine\V1\UpdateTripRequest; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Trip management service. @@ -133,14 +134,14 @@ public static function tripName(string $provider, string $trip): string * listed, then parseName will check each of the supported templates, and return * the first match. * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match * * @return array An associative array from name component IDs to component values. * * @throws ValidationException If $formattedName could not be matched. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -195,6 +196,9 @@ public static function parseName(string $formattedName, string $template = null) * @type callable $clientCertSource * A callable which returns the client cert as a string. This can be used to * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php b/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php index 9eb70d735cf0..c33555a3df8d 100644 --- a/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php +++ b/MapsFleetEngine/src/V1/Client/VehicleServiceClient.php @@ -44,6 +44,7 @@ use Google\Maps\FleetEngine\V1\Vehicle; use Google\Maps\FleetEngine\V1\Vehicle\VehicleType; use GuzzleHttp\Promise\PromiseInterface; +use Psr\Log\LoggerInterface; /** * Service Description: Vehicle management service. @@ -138,14 +139,14 @@ public static function vehicleName(string $provider, string $vehicle): string * listed, then parseName will check each of the supported templates, and return * the first match. * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match + * @param string $formattedName The formatted name string + * @param ?string $template Optional name of template to match * * @return array An associative array from name component IDs to component values. * * @throws ValidationException If $formattedName could not be matched. */ - public static function parseName(string $formattedName, string $template = null): array + public static function parseName(string $formattedName, ?string $template = null): array { return self::parseFormattedName($formattedName, $template); } @@ -200,6 +201,9 @@ public static function parseName(string $formattedName, string $template = null) * @type callable $clientCertSource * A callable which returns the client cert as a string. This can be used to * provide a certificate and private key to the transport layer for mTLS. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag * } * * @throws ValidationException diff --git a/MapsFleetEngine/src/V1/VehicleMatch.php b/MapsFleetEngine/src/V1/VehicleMatch.php index d0945ffdbcbf..70cfc1b7f9f8 100644 --- a/MapsFleetEngine/src/V1/VehicleMatch.php +++ b/MapsFleetEngine/src/V1/VehicleMatch.php @@ -98,16 +98,15 @@ class VehicleMatch extends \Google\Protobuf\Internal\Message */ protected $vehicle_match_type = 0; /** - * The order requested for sorting vehicle matches. + * The order requested for sorting vehicle matches. Equivalent to + * `ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; */ protected $requested_ordered_by = 0; /** - * The actual order that was used for this vehicle. Normally this - * will match the 'order_by' field from the request; however, in certain - * circumstances such as an internal server error, a different method - * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * The order requested for sorting vehicle matches. Equivalent to + * `requested_ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; */ @@ -165,12 +164,11 @@ class VehicleMatch extends \Google\Protobuf\Internal\Message * @type int $vehicle_match_type * Type of the vehicle match. * @type int $requested_ordered_by - * The order requested for sorting vehicle matches. + * The order requested for sorting vehicle matches. Equivalent to + * `ordered_by`. * @type int $ordered_by - * The actual order that was used for this vehicle. Normally this - * will match the 'order_by' field from the request; however, in certain - * circumstances such as an internal server error, a different method - * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * The order requested for sorting vehicle matches. Equivalent to + * `requested_ordered_by`. * } */ public function __construct($data = NULL) { @@ -636,7 +634,8 @@ public function setVehicleMatchType($var) } /** - * The order requested for sorting vehicle matches. + * The order requested for sorting vehicle matches. Equivalent to + * `ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; * @return int @@ -647,7 +646,8 @@ public function getRequestedOrderedBy() } /** - * The order requested for sorting vehicle matches. + * The order requested for sorting vehicle matches. Equivalent to + * `ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder requested_ordered_by = 9; * @param int $var @@ -662,10 +662,8 @@ public function setRequestedOrderedBy($var) } /** - * The actual order that was used for this vehicle. Normally this - * will match the 'order_by' field from the request; however, in certain - * circumstances such as an internal server error, a different method - * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * The order requested for sorting vehicle matches. Equivalent to + * `requested_ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; * @return int @@ -676,10 +674,8 @@ public function getOrderedBy() } /** - * The actual order that was used for this vehicle. Normally this - * will match the 'order_by' field from the request; however, in certain - * circumstances such as an internal server error, a different method - * may be used (such as `PICKUP_POINT_STRAIGHT_DISTANCE`). + * The order requested for sorting vehicle matches. Equivalent to + * `requested_ordered_by`. * * Generated from protobuf field .maps.fleetengine.v1.SearchVehiclesRequest.VehicleMatchOrder ordered_by = 10; * @param int $var