Skip to content

Commit 3e6940f

Browse files
committed
Boolify pdo_hash_methods()
1 parent 262744f commit 3e6940f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/pdo/pdo_dbh.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ static void cls_method_pdtor(zval *el) /* {{{ */ {
11731173
/* }}} */
11741174

11751175
/* {{{ overloaded object handlers for PDO class */
1176-
int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
1176+
bool pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
11771177
{
11781178
const zend_function_entry *funcs;
11791179
zend_internal_function func;
@@ -1182,11 +1182,11 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
11821182
pdo_dbh_t *dbh = dbh_obj->inner;
11831183

11841184
if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) {
1185-
return 0;
1185+
return false;
11861186
}
11871187
funcs = dbh->methods->get_driver_methods(dbh, kind);
11881188
if (!funcs) {
1189-
return 0;
1189+
return false;
11901190
}
11911191

11921192
dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent);
@@ -1238,7 +1238,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
12381238
funcs++;
12391239
}
12401240

1241-
return 1;
1241+
return true;
12421242
}
12431243

12441244
static zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key)

ext/pdo/php_pdo_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
5656
void pdo_sqlstate_init_error_table(void);
5757
void pdo_sqlstate_fini_error_table(void);
5858
const char *pdo_sqlstate_state_to_description(char *state);
59-
int pdo_hash_methods(pdo_dbh_object_t *dbh, int kind);
59+
bool pdo_hash_methods(pdo_dbh_object_t *dbh, int kind);

0 commit comments

Comments
 (0)