Skip to content

Commit 9df6ec1

Browse files
committed
clang-format code before code review
1 parent 8195a44 commit 9df6ec1

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

agent/lib_composer.c

+16-8
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
7676

7777
// nurunlikely because this should alredy be ensured by the caller
7878
if (nrunlikely(!NRINI(vulnerability_management_package_detection_enabled))) {
79-
// do nothing when collecting package information for vulnerability management is disabled
79+
// do nothing when collecting package information for vulnerability
80+
// management is disabled
8081
return;
8182
}
8283

@@ -86,6 +87,7 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
8687
return;
8788
}
8889

90+
// clang-format off
8991
char* getallrawdata
9092
= ""
9193
"(function() {"
@@ -107,6 +109,7 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
107109
" return NULL;"
108110
" }"
109111
"})();";
112+
// clang-format on
110113

111114
if (NR_SUCCESS != nr_execute_handle_autoload_composer_init(vendor_path)) {
112115
nrl_debug(NRL_INSTRUMENT,
@@ -119,30 +122,35 @@ static void nr_execute_handle_autoload_composer_get_packages_information(
119122
nrl_verbosedebug(NRL_INSTRUMENT, "%s - Composer runtime API available",
120123
__func__);
121124

122-
result = zend_eval_string(getallrawdata, &retval, "composer_getallrawdata.php");
125+
result
126+
= zend_eval_string(getallrawdata, &retval, "composer_getallrawdata.php");
123127
if (SUCCESS != result) {
124-
nrl_verbosedebug(NRL_INSTRUMENT, "%s - composer_getallrawdata.php failed", __func__);
128+
nrl_verbosedebug(NRL_INSTRUMENT, "%s - composer_getallrawdata.php failed",
129+
__func__);
125130
return;
126131
}
127132
if (IS_ARRAY == Z_TYPE(retval)) {
128133
zend_string* package_name = NULL;
129134
zval* package_version = NULL;
130-
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL(retval), package_name, package_version) {
135+
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL(retval), package_name,
136+
package_version) {
131137
if (NULL == package_name || NULL == package_version) {
132138
continue;
133139
}
134140
if (nr_php_is_zval_non_empty_string(package_version)) {
135141
nrl_verbosedebug(NRL_INSTRUMENT, "package %s, version %s",
136142
NRSAFESTR(ZSTR_VAL(package_name)),
137143
NRSAFESTR(Z_STRVAL_P(package_version)));
138-
nr_txn_add_php_package_from_source(NRPRG(txn), NRSAFESTR(ZSTR_VAL(package_name)),
139-
NRSAFESTR(Z_STRVAL_P(package_version)), NR_PHP_PACKAGE_SOURCE_COMPOSER);
144+
nr_txn_add_php_package_from_source(
145+
NRPRG(txn), NRSAFESTR(ZSTR_VAL(package_name)),
146+
NRSAFESTR(Z_STRVAL_P(package_version)),
147+
NR_PHP_PACKAGE_SOURCE_COMPOSER);
140148
}
141149
}
142150
ZEND_HASH_FOREACH_END();
143151
} else {
144-
nrl_verbosedebug(NRL_INSTRUMENT,
145-
"%s - installed packages is not an array", __func__);
152+
nrl_verbosedebug(NRL_INSTRUMENT, "%s - installed packages is not an array",
153+
__func__);
146154
}
147155
zval_dtor(&retval);
148156
}

agent/php_execute.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,8 @@ static void nr_execute_handle_library(const char* filename,
931931
}
932932
}
933933

934-
static void nr_execute_handle_autoload(const char* filename, const size_t filename_len) {
934+
static void nr_execute_handle_autoload(const char* filename,
935+
const size_t filename_len) {
935936
#define AUTOLOAD_MAGIC_FILE "vendor/autoload.php"
936937
#define AUTOLOAD_MAGIC_FILE_LEN (sizeof(AUTOLOAD_MAGIC_FILE) - 1)
937938

@@ -950,12 +951,14 @@ static void nr_execute_handle_autoload(const char* filename, const size_t filena
950951
return;
951952
}
952953

953-
if (!nr_striendswith(STR_AND_LEN(filename), AUTOLOAD_MAGIC_FILE, AUTOLOAD_MAGIC_FILE_LEN)) {
954+
if (!nr_striendswith(STR_AND_LEN(filename), AUTOLOAD_MAGIC_FILE,
955+
AUTOLOAD_MAGIC_FILE_LEN)) {
954956
// not an autoload file
955957
return;
956958
}
957959

958-
nrl_debug(NRL_FRAMEWORK, "detected autoload with %s, which ends with %s", filename, AUTOLOAD_MAGIC_FILE);
960+
nrl_debug(NRL_FRAMEWORK, "detected autoload with %s, which ends with %s",
961+
filename, AUTOLOAD_MAGIC_FILE);
959962
NRPRG(txn)->composer_info.autoload_detected = true;
960963
nr_fw_support_add_library_supportability_metric(NRPRG(txn), "Autoloader");
961964

0 commit comments

Comments
 (0)