diff --git a/CHANGELOG.md b/CHANGELOG.md index 474f441..a279faa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Changed + +- Enable compiler optimization for the `sprintf` function. + ## 2.3.1 ### Changed diff --git a/src/Input/ChangeResourceRecordSetsRequest.php b/src/Input/ChangeResourceRecordSetsRequest.php index 92baa2a..c1bb30d 100644 --- a/src/Input/ChangeResourceRecordSetsRequest.php +++ b/src/Input/ChangeResourceRecordSetsRequest.php @@ -82,7 +82,7 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->hostedZoneId) { - throw new InvalidArgument(sprintf('Missing parameter "HostedZoneId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "HostedZoneId" for "%s". The value cannot be null.', __CLASS__)); } $v = preg_replace('#^(/hostedzone/|/change/|/delegationset/)#', '', $v); $uri['Id'] = $v; @@ -118,7 +118,7 @@ public function setHostedZoneId(?string $value): self private function requestBody(\DOMNode $node, \DOMDocument $document): void { if (null === $v = $this->changeBatch) { - throw new InvalidArgument(sprintf('Missing parameter "ChangeBatch" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "ChangeBatch" for "%s". The value cannot be null.', __CLASS__)); } $node->appendChild($child = $document->createElement('ChangeBatch')); diff --git a/src/Input/CreateHostedZoneRequest.php b/src/Input/CreateHostedZoneRequest.php index 8517a3f..47ca1ca 100644 --- a/src/Input/CreateHostedZoneRequest.php +++ b/src/Input/CreateHostedZoneRequest.php @@ -209,7 +209,7 @@ public function setVpc(?VPC $value): self private function requestBody(\DOMNode $node, \DOMDocument $document): void { 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__)); } $node->appendChild($document->createElement('Name', $v)); if (null !== $v = $this->vpc) { @@ -218,7 +218,7 @@ private function requestBody(\DOMNode $node, \DOMDocument $document): void $v->requestBody($child, $document); } if (null === $v = $this->callerReference) { - throw new InvalidArgument(sprintf('Missing parameter "CallerReference" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "CallerReference" for "%s". The value cannot be null.', __CLASS__)); } $node->appendChild($document->createElement('CallerReference', $v)); if (null !== $v = $this->hostedZoneConfig) { diff --git a/src/Input/DeleteHostedZoneRequest.php b/src/Input/DeleteHostedZoneRequest.php index 2c22714..331996c 100644 --- a/src/Input/DeleteHostedZoneRequest.php +++ b/src/Input/DeleteHostedZoneRequest.php @@ -63,7 +63,7 @@ public function request(): Request // Prepare URI $uri = []; 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__)); } $v = preg_replace('#^(/hostedzone/|/change/|/delegationset/)#', '', $v); $uri['Id'] = $v; diff --git a/src/Input/GetChangeRequest.php b/src/Input/GetChangeRequest.php index b525957..bd6c8e8 100644 --- a/src/Input/GetChangeRequest.php +++ b/src/Input/GetChangeRequest.php @@ -64,7 +64,7 @@ public function request(): Request // Prepare URI $uri = []; 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__)); } $v = preg_replace('#^(/hostedzone/|/change/|/delegationset/)#', '', $v); $uri['Id'] = $v; diff --git a/src/Input/ListHostedZonesRequest.php b/src/Input/ListHostedZonesRequest.php index 017ef5d..789f2e6 100644 --- a/src/Input/ListHostedZonesRequest.php +++ b/src/Input/ListHostedZonesRequest.php @@ -127,7 +127,7 @@ public function request(): Request } if (null !== $this->hostedZoneType) { if (!HostedZoneType::exists($this->hostedZoneType)) { - throw new InvalidArgument(sprintf('Invalid parameter "HostedZoneType" for "%s". The value "%s" is not a valid "HostedZoneType".', __CLASS__, $this->hostedZoneType)); + throw new InvalidArgument(\sprintf('Invalid parameter "HostedZoneType" for "%s". The value "%s" is not a valid "HostedZoneType".', __CLASS__, $this->hostedZoneType)); } $query['hostedzonetype'] = $this->hostedZoneType; } diff --git a/src/Input/ListResourceRecordSetsRequest.php b/src/Input/ListResourceRecordSetsRequest.php index efc6749..2845dd9 100644 --- a/src/Input/ListResourceRecordSetsRequest.php +++ b/src/Input/ListResourceRecordSetsRequest.php @@ -153,7 +153,7 @@ public function request(): Request } if (null !== $this->startRecordType) { if (!RRType::exists($this->startRecordType)) { - throw new InvalidArgument(sprintf('Invalid parameter "StartRecordType" for "%s". The value "%s" is not a valid "RRType".', __CLASS__, $this->startRecordType)); + throw new InvalidArgument(\sprintf('Invalid parameter "StartRecordType" for "%s". The value "%s" is not a valid "RRType".', __CLASS__, $this->startRecordType)); } $query['type'] = $this->startRecordType; } @@ -167,7 +167,7 @@ public function request(): Request // Prepare URI $uri = []; if (null === $v = $this->hostedZoneId) { - throw new InvalidArgument(sprintf('Missing parameter "HostedZoneId" for "%s". The value cannot be null.', __CLASS__)); + throw new InvalidArgument(\sprintf('Missing parameter "HostedZoneId" for "%s". The value cannot be null.', __CLASS__)); } $v = preg_replace('#^(/hostedzone/|/change/|/delegationset/)#', '', $v); $uri['Id'] = $v; diff --git a/src/ValueObject/Change.php b/src/ValueObject/Change.php index 09e1e19..eca5ab9 100644 --- a/src/ValueObject/Change.php +++ b/src/ValueObject/Change.php @@ -80,7 +80,7 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void { $v = $this->action; if (!ChangeAction::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "Action" for "%s". The value "%s" is not a valid "ChangeAction".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "Action" for "%s". The value "%s" is not a valid "ChangeAction".', __CLASS__, $v)); } $node->appendChild($document->createElement('Action', $v)); $v = $this->resourceRecordSet; diff --git a/src/ValueObject/ResourceRecordSet.php b/src/ValueObject/ResourceRecordSet.php index 6751d60..b209920 100644 --- a/src/ValueObject/ResourceRecordSet.php +++ b/src/ValueObject/ResourceRecordSet.php @@ -567,7 +567,7 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void $node->appendChild($document->createElement('Name', $v)); $v = $this->type; if (!RRType::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "Type" for "%s". The value "%s" is not a valid "RRType".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "Type" for "%s". The value "%s" is not a valid "RRType".', __CLASS__, $v)); } $node->appendChild($document->createElement('Type', $v)); if (null !== $v = $this->setIdentifier) { @@ -578,7 +578,7 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void } if (null !== $v = $this->region) { if (!ResourceRecordSetRegion::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "Region" for "%s". The value "%s" is not a valid "ResourceRecordSetRegion".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "Region" for "%s". The value "%s" is not a valid "ResourceRecordSetRegion".', __CLASS__, $v)); } $node->appendChild($document->createElement('Region', $v)); } @@ -589,7 +589,7 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void } if (null !== $v = $this->failover) { if (!ResourceRecordSetFailover::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "Failover" for "%s". The value "%s" is not a valid "ResourceRecordSetFailover".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "Failover" for "%s". The value "%s" is not a valid "ResourceRecordSetFailover".', __CLASS__, $v)); } $node->appendChild($document->createElement('Failover', $v)); } diff --git a/src/ValueObject/VPC.php b/src/ValueObject/VPC.php index cf77e03..e45891a 100644 --- a/src/ValueObject/VPC.php +++ b/src/ValueObject/VPC.php @@ -70,7 +70,7 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void { if (null !== $v = $this->vpcRegion) { if (!VPCRegion::exists($v)) { - throw new InvalidArgument(sprintf('Invalid parameter "VPCRegion" for "%s". The value "%s" is not a valid "VPCRegion".', __CLASS__, $v)); + throw new InvalidArgument(\sprintf('Invalid parameter "VPCRegion" for "%s". The value "%s" is not a valid "VPCRegion".', __CLASS__, $v)); } $node->appendChild($document->createElement('VPCRegion', $v)); }