Type hinting and void return question

Callback functions for anaction hook don’t need to return anything, so based on the description here:

A void return type has been introduced. Functions declared with void
as their return type must either omit their return statement
altogether, or use an empty return statement. NULL is not a valid
return value for a void function.

void would be appropriate in this context. Note that your register_test_post_type() method does not actually return the value of register_post_type(). So while register_post_type() might return a post type object, your function doesn’t.

error code: 523