@@ -545,35 +545,34 @@ void nr_lib_aws_sdk_php_dynamodb_set_params(
545
545
546
546
if (NULL != func -> common .scope ) {
547
547
base_class = func -> common .scope ;
548
- }
549
548
550
- region_zval = nr_php_get_zval_object_property_with_class (this_obj , base_class ,
551
- "region" );
552
- if (nr_php_is_zval_non_empty_string (region_zval )) {
553
- cloud_attrs -> cloud_region = Z_STRVAL_P (region_zval );
554
- }
555
-
556
- endpoint_zval = nr_php_get_zval_object_property_with_class (
557
- this_obj , base_class , "endpoint" );
558
- if (nr_php_is_zval_valid_object (endpoint_zval )) {
559
- host_zval = nr_php_get_zval_object_property (endpoint_zval , "host" );
560
- if (nr_php_is_zval_non_empty_string (host_zval )) {
561
- datastore_params -> instance -> host = Z_STRVAL_P (host_zval );
562
-
563
- /* Only try to get a port if we have a valid host. */
564
- port_zval = nr_php_get_zval_object_property (endpoint_zval , "port" );
565
- if (nr_php_is_zval_valid_integer (port_zval )) {
566
- /* Must be freed by caller */
567
- datastore_params -> instance -> port_path_or_id
568
- = nr_formatf (NR_INT64_FMT , Z_LVAL_P (port_zval ));
569
- } else {
570
- /* In case where host was found but port was not, spec says return
571
- * unknown for port. */
572
- datastore_params -> instance -> port_path_or_id = nr_strdup ("unknown" );
549
+ region_zval = nr_php_get_zval_object_property_with_class (
550
+ this_obj , base_class , "region" );
551
+ if (nr_php_is_zval_non_empty_string (region_zval )) {
552
+ cloud_attrs -> cloud_region = Z_STRVAL_P (region_zval );
553
+ }
554
+
555
+ endpoint_zval = nr_php_get_zval_object_property_with_class (
556
+ this_obj , base_class , "endpoint" );
557
+ if (nr_php_is_zval_valid_object (endpoint_zval )) {
558
+ host_zval = nr_php_get_zval_object_property (endpoint_zval , "host" );
559
+ if (nr_php_is_zval_non_empty_string (host_zval )) {
560
+ datastore_params -> instance -> host = Z_STRVAL_P (host_zval );
561
+
562
+ /* Only try to get a port if we have a valid host. */
563
+ port_zval = nr_php_get_zval_object_property (endpoint_zval , "port" );
564
+ if (nr_php_is_zval_valid_integer (port_zval )) {
565
+ /* Must be freed by caller */
566
+ datastore_params -> instance -> port_path_or_id
567
+ = nr_formatf (NR_INT64_FMT , Z_LVAL_P (port_zval ));
568
+ } else {
569
+ /* In case where host was found but port was not, spec says return
570
+ * unknown for port. */
571
+ datastore_params -> instance -> port_path_or_id = nr_strdup ("unknown" );
572
+ }
573
573
}
574
574
}
575
575
}
576
-
577
576
if (NULL == datastore_params -> instance -> host ) {
578
577
/* Unable to retrieve the endpoint, go with AWS defaults. */
579
578
datastore_params -> instance -> host = AWS_SDK_PHP_DYNAMODBCLIENT_DEFAULT_HOST ;
0 commit comments