@@ -351,14 +351,14 @@ class ClassImpl
351351 * @param flags Optional flags
352352 * @param args Description of the supported arguments
353353 */
354- void method (const char *name, const method_callback_0 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
355- void method (const char *name, const method_callback_1 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
356- void method (const char *name, const method_callback_2 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
357- void method (const char *name, const method_callback_3 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
358- void method (const char *name, const method_callback_4 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
359- void method (const char *name, const method_callback_5 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
360- void method (const char *name, const method_callback_6 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
361- void method (const char *name, const method_callback_7 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags, args)); }
354+ void method (const char *name, const method_callback_0 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
355+ void method (const char *name, const method_callback_1 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
356+ void method (const char *name, const method_callback_2 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
357+ void method (const char *name, const method_callback_3 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
358+ void method (const char *name, const method_callback_4 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
359+ void method (const char *name, const method_callback_5 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
360+ void method (const char *name, const method_callback_6 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
361+ void method (const char *name, const method_callback_7 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags & MethodModifiers , args)); }
362362
363363 /* *
364364 * Add a static method to the class
@@ -372,10 +372,10 @@ class ClassImpl
372372 * @param flags Optional flags
373373 * @param args Description of the supported arguments
374374 */
375- void method (const char *name, const native_callback_0 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags | ZEND_ACC_STATIC , args)); }
376- void method (const char *name, const native_callback_1 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags | ZEND_ACC_STATIC , args)); }
377- void method (const char *name, const native_callback_2 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags | ZEND_ACC_STATIC , args)); }
378- void method (const char *name, const native_callback_3 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, flags | ZEND_ACC_STATIC , args)); }
375+ void method (const char *name, const native_callback_0 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, ( flags & MethodModifiers) | Static , args)); }
376+ void method (const char *name, const native_callback_1 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, ( flags & MethodModifiers) | Static , args)); }
377+ void method (const char *name, const native_callback_2 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, ( flags & MethodModifiers) | Static , args)); }
378+ void method (const char *name, const native_callback_3 &method, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, method, ( flags & MethodModifiers) | Static , args)); }
379379
380380 /* *
381381 * Add an abstract method to the class
@@ -384,7 +384,7 @@ class ClassImpl
384384 * @param flags Optional flags (like public or protected)
385385 * @param args Description of the supported arguments
386386 */
387- void method (const char *name, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, Abstract | flags , args)); }
387+ void method (const char *name, int flags=0 , const Arguments &args = {}) { _methods.push_back (std::make_shared<Method>(name, (flags & (MethodModifiers | Static)) | Abstract , args)); }
388388
389389 /* *
390390 * Add a property to the class
@@ -399,15 +399,15 @@ class ClassImpl
399399 * @param value Actual property value
400400 * @param flags Optional flags
401401 */
402- void property (const char *name, std::nullptr_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NullMember>(name, flags)); }
403- void property (const char *name, int16_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags)); }
404- void property (const char *name, int32_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags)); }
405- void property (const char *name, int64_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags)); }
406- void property (const char *name, bool value, int flags = Php::Public) { _members.push_back (std::make_shared<BoolMember>(name, value, flags)); }
407- void property (const char *name, char value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember>(name, &value, 1 , flags)); }
408- void property (const char *name, const std::string &value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember>(name, value, flags)); }
409- void property (const char *name, const char *value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember>(name, value, strlen (value), flags)); }
410- void property (const char *name, double value, int flags = Php::Public) { _members.push_back (std::make_shared<FloatMember>(name, value, flags)); }
402+ void property (const char *name, std::nullptr_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NullMember> (name, flags & PropertyModifiers )); }
403+ void property (const char *name, int16_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags & PropertyModifiers )); }
404+ void property (const char *name, int32_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags & PropertyModifiers )); }
405+ void property (const char *name, int64_t value, int flags = Php::Public) { _members.push_back (std::make_shared<NumericMember>(name, value, flags & PropertyModifiers )); }
406+ void property (const char *name, bool value, int flags = Php::Public) { _members.push_back (std::make_shared<BoolMember> (name, value, flags & PropertyModifiers )); }
407+ void property (const char *name, char value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember> (name, &value, 1 , flags & PropertyModifiers )); }
408+ void property (const char *name, const std::string &value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember> (name, value, flags & PropertyModifiers )); }
409+ void property (const char *name, const char *value, int flags = Php::Public) { _members.push_back (std::make_shared<StringMember> (name, value, strlen (value), flags & PropertyModifiers )); }
410+ void property (const char *name, double value, int flags = Php::Public) { _members.push_back (std::make_shared<FloatMember> (name, value, flags & PropertyModifiers )); }
411411
412412 /* *
413413 * Set property with callbacks
0 commit comments