From acddeff6fb8e3173f6039b992416b13380a5515c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 30 Jul 2024 13:36:17 +0200 Subject: [PATCH] Bump php-cs-fixer to version 3.60 (#1743) --- CHANGELOG.md | 4 ++++ src/Input/CreateResolverRequest.php | 10 +++++----- src/Input/DeleteResolverRequest.php | 6 +++--- src/Input/GetSchemaCreationStatusRequest.php | 2 +- src/Input/ListApiKeysRequest.php | 2 +- src/Input/ListResolversRequest.php | 4 ++-- src/Input/StartSchemaCreationRequest.php | 4 ++-- src/Input/UpdateApiKeyRequest.php | 4 ++-- src/Input/UpdateDataSourceRequest.php | 10 +++++----- src/Input/UpdateResolverRequest.php | 10 +++++----- src/ValueObject/AppSyncRuntime.php | 2 +- src/ValueObject/AuthorizationConfig.php | 2 +- src/ValueObject/RelationalDatabaseDataSourceConfig.php | 2 +- src/ValueObject/SyncConfig.php | 4 ++-- 14 files changed, 35 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae6eff6..8dd9f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - AWS api-change: Adding support for paginators in AppSync list APIs +### Changed + +- Enable compiler optimization for the `sprintf` function. + ## 2.1.1 ### Changed diff --git a/src/Input/CreateResolverRequest.php b/src/Input/CreateResolverRequest.php index cbc847f..a437520 100644 --- a/src/Input/CreateResolverRequest.php +++ b/src/Input/CreateResolverRequest.php @@ -289,11 +289,11 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->typeName) { - throw new InvalidArgument(sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); } $uri['typeName'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/types/' . rawurlencode($uri['typeName']) . '/resolvers'; @@ -415,7 +415,7 @@ private function requestBody(): array $payload = []; if (null === $v = $this->fieldName) { - throw new InvalidArgument(sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); } $payload['fieldName'] = $v; if (null !== $v = $this->dataSourceName) { @@ -429,7 +429,7 @@ private function requestBody(): array } if (null !== $v = $this->kind) { if (!ResolverKind::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "kind" for "%s". The value "%s" is not a valid "ResolverKind".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "kind" for "%s". The value "%s" is not a valid "ResolverKind".', __CLASS__, $v)); } $payload['kind'] = $v; } @@ -453,7 +453,7 @@ private function requestBody(): array } if (null !== $v = $this->metricsConfig) { if (!ResolverLevelMetricsConfig::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); } $payload['metricsConfig'] = $v; } diff --git a/src/Input/DeleteResolverRequest.php b/src/Input/DeleteResolverRequest.php index 06bafa0..520e292 100644 --- a/src/Input/DeleteResolverRequest.php +++ b/src/Input/DeleteResolverRequest.php @@ -97,15 +97,15 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->typeName) { - throw new InvalidArgument(sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); } $uri['typeName'] = $v; if (null === $v = $this->fieldName) { - throw new InvalidArgument(sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); } $uri['fieldName'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/types/' . rawurlencode($uri['typeName']) . '/resolvers/' . rawurlencode($uri['fieldName']); diff --git a/src/Input/GetSchemaCreationStatusRequest.php b/src/Input/GetSchemaCreationStatusRequest.php index fee227f..9c1315a 100644 --- a/src/Input/GetSchemaCreationStatusRequest.php +++ b/src/Input/GetSchemaCreationStatusRequest.php @@ -63,7 +63,7 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/schemacreation'; diff --git a/src/Input/ListApiKeysRequest.php b/src/Input/ListApiKeysRequest.php index 4679ee0..fcf93a3 100644 --- a/src/Input/ListApiKeysRequest.php +++ b/src/Input/ListApiKeysRequest.php @@ -100,7 +100,7 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/apikeys'; diff --git a/src/Input/ListResolversRequest.php b/src/Input/ListResolversRequest.php index 5ebc7f8..7143468 100644 --- a/src/Input/ListResolversRequest.php +++ b/src/Input/ListResolversRequest.php @@ -117,11 +117,11 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->typeName) { - throw new InvalidArgument(sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); } $uri['typeName'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/types/' . rawurlencode($uri['typeName']) . '/resolvers'; diff --git a/src/Input/StartSchemaCreationRequest.php b/src/Input/StartSchemaCreationRequest.php index dd77a2c..e648a3d 100644 --- a/src/Input/StartSchemaCreationRequest.php +++ b/src/Input/StartSchemaCreationRequest.php @@ -80,7 +80,7 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/schemacreation'; @@ -112,7 +112,7 @@ private function requestBody(): array $payload = []; if (null === $v = $this->definition) { - throw new InvalidArgument(sprintf('Missing parameter "definition" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "definition" for "%s". The value cannot be null.', __CLASS__)); } $payload['definition'] = base64_encode($v); diff --git a/src/Input/UpdateApiKeyRequest.php b/src/Input/UpdateApiKeyRequest.php index ed9b48e..6f33051 100644 --- a/src/Input/UpdateApiKeyRequest.php +++ b/src/Input/UpdateApiKeyRequest.php @@ -111,11 +111,11 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->id) { - throw new InvalidArgument(sprintf('Missing parameter "id" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "id" for "%s". The value cannot be null.', __CLASS__)); } $uri['id'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/apikeys/' . rawurlencode($uri['id']); diff --git a/src/Input/UpdateDataSourceRequest.php b/src/Input/UpdateDataSourceRequest.php index 270e59d..429ce1b 100644 --- a/src/Input/UpdateDataSourceRequest.php +++ b/src/Input/UpdateDataSourceRequest.php @@ -270,11 +270,11 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->name) { - throw new InvalidArgument(sprintf('Missing parameter "name" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "name" for "%s". The value cannot be null.', __CLASS__)); } $uri['name'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/datasources/' . rawurlencode($uri['name']); @@ -392,10 +392,10 @@ private function requestBody(): array $payload['description'] = $v; } if (null === $v = $this->type) { - throw new InvalidArgument(sprintf('Missing parameter "type" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "type" for "%s". The value cannot be null.', __CLASS__)); } if (!DataSourceType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "type" for "%s". The value "%s" is not a valid "DataSourceType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "type" for "%s". The value "%s" is not a valid "DataSourceType".', __CLASS__, $v)); } $payload['type'] = $v; if (null !== $v = $this->serviceRoleArn) { @@ -424,7 +424,7 @@ private function requestBody(): array } if (null !== $v = $this->metricsConfig) { if (!DataSourceLevelMetricsConfig::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "DataSourceLevelMetricsConfig".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "DataSourceLevelMetricsConfig".', __CLASS__, $v)); } $payload['metricsConfig'] = $v; } diff --git a/src/Input/UpdateResolverRequest.php b/src/Input/UpdateResolverRequest.php index 798eadc..83adaa2 100644 --- a/src/Input/UpdateResolverRequest.php +++ b/src/Input/UpdateResolverRequest.php @@ -289,15 +289,15 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->apiId) { - throw new InvalidArgument(sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "apiId" for "%s". The value cannot be null.', __CLASS__)); } $uri['apiId'] = $v; if (null === $v = $this->typeName) { - throw new InvalidArgument(sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "typeName" for "%s". The value cannot be null.', __CLASS__)); } $uri['typeName'] = $v; if (null === $v = $this->fieldName) { - throw new InvalidArgument(sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "fieldName" for "%s". The value cannot be null.', __CLASS__)); } $uri['fieldName'] = $v; $uriString = '/v1/apis/' . rawurlencode($uri['apiId']) . '/types/' . rawurlencode($uri['typeName']) . '/resolvers/' . rawurlencode($uri['fieldName']); @@ -429,7 +429,7 @@ private function requestBody(): array } if (null !== $v = $this->kind) { if (!ResolverKind::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "kind" for "%s". The value "%s" is not a valid "ResolverKind".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "kind" for "%s". The value "%s" is not a valid "ResolverKind".', __CLASS__, $v)); } $payload['kind'] = $v; } @@ -453,7 +453,7 @@ private function requestBody(): array } if (null !== $v = $this->metricsConfig) { if (!ResolverLevelMetricsConfig::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "metricsConfig" for "%s". The value "%s" is not a valid "ResolverLevelMetricsConfig".', __CLASS__, $v)); } $payload['metricsConfig'] = $v; } diff --git a/src/ValueObject/AppSyncRuntime.php b/src/ValueObject/AppSyncRuntime.php index d9147f6..38ecfd5 100644 --- a/src/ValueObject/AppSyncRuntime.php +++ b/src/ValueObject/AppSyncRuntime.php @@ -70,7 +70,7 @@ public function requestBody(): array $payload = []; $v = $this->name; if (!RuntimeName::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "name" for "%s". The value "%s" is not a valid "RuntimeName".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "name" for "%s". The value "%s" is not a valid "RuntimeName".', __CLASS__, $v)); } $payload['name'] = $v; $v = $this->runtimeVersion; diff --git a/src/ValueObject/AuthorizationConfig.php b/src/ValueObject/AuthorizationConfig.php index 27ee457..10ce1f8 100644 --- a/src/ValueObject/AuthorizationConfig.php +++ b/src/ValueObject/AuthorizationConfig.php @@ -70,7 +70,7 @@ public function requestBody(): array $payload = []; $v = $this->authorizationType; if (!AuthorizationType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "authorizationType" for "%s". The value "%s" is not a valid "AuthorizationType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "authorizationType" for "%s". The value "%s" is not a valid "AuthorizationType".', __CLASS__, $v)); } $payload['authorizationType'] = $v; if (null !== $v = $this->awsIamConfig) { diff --git a/src/ValueObject/RelationalDatabaseDataSourceConfig.php b/src/ValueObject/RelationalDatabaseDataSourceConfig.php index 67e1d72..dfb0e38 100644 --- a/src/ValueObject/RelationalDatabaseDataSourceConfig.php +++ b/src/ValueObject/RelationalDatabaseDataSourceConfig.php @@ -71,7 +71,7 @@ public function requestBody(): array $payload = []; if (null !== $v = $this->relationalDatabaseSourceType) { if (!RelationalDatabaseSourceType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "relationalDatabaseSourceType" for "%s". The value "%s" is not a valid "RelationalDatabaseSourceType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "relationalDatabaseSourceType" for "%s". The value "%s" is not a valid "RelationalDatabaseSourceType".', __CLASS__, $v)); } $payload['relationalDatabaseSourceType'] = $v; } diff --git a/src/ValueObject/SyncConfig.php b/src/ValueObject/SyncConfig.php index 29b8489..837bd73 100644 --- a/src/ValueObject/SyncConfig.php +++ b/src/ValueObject/SyncConfig.php @@ -97,13 +97,13 @@ public function requestBody(): array $payload = []; if (null !== $v = $this->conflictHandler) { if (!ConflictHandlerType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "conflictHandler" for "%s". The value "%s" is not a valid "ConflictHandlerType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "conflictHandler" for "%s". The value "%s" is not a valid "ConflictHandlerType".', __CLASS__, $v)); } $payload['conflictHandler'] = $v; } if (null !== $v = $this->conflictDetection) { if (!ConflictDetectionType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "conflictDetection" for "%s". The value "%s" is not a valid "ConflictDetectionType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "conflictDetection" for "%s". The value "%s" is not a valid "ConflictDetectionType".', __CLASS__, $v)); } $payload['conflictDetection'] = $v; }