@@ -26,38 +26,38 @@ trait ReflectionTrait {
2626 * Method result.
2727 */
2828 protected static function callProtectedMethod (object |string $ object , string $ name , array $ args = []) {
29- $ objectOrClass = is_object ($ object ) ? $ object ::class : $ object ;
29+ $ object_or_class = is_object ($ object ) ? $ object ::class : $ object ;
3030
31- if (!class_exists ($ objectOrClass )) {
32- throw new \InvalidArgumentException (sprintf ('Class %s does not exist ' , $ objectOrClass ));
31+ if (!class_exists ($ object_or_class )) {
32+ throw new \InvalidArgumentException (sprintf ('Class %s does not exist ' , $ object_or_class ));
3333 }
3434
35- $ class = new \ReflectionClass ($ objectOrClass );
35+ $ class = new \ReflectionClass ($ object_or_class );
3636
3737 if (!$ class ->hasMethod ($ name )) {
3838 throw new \InvalidArgumentException (sprintf ('Method %s does not exist ' , $ name ));
3939 }
4040
4141 $ method = $ class ->getMethod ($ name );
4242
43- $ originalAccessibility = $ method ->isPublic ();
43+ $ original_accessibility = $ method ->isPublic ();
4444
4545 // Set method accessibility to true, so it can be invoked.
4646 $ method ->setAccessible (TRUE );
4747
4848 // If the method is static, we won't pass an object instance to invokeArgs()
4949 // Otherwise, we ensure to pass the object instance.
50- $ invokeObject = $ method ->isStatic () ? NULL : (is_object ($ object ) ? $ object : NULL );
50+ $ invoke_object = $ method ->isStatic () ? NULL : (is_object ($ object ) ? $ object : NULL );
5151
5252 // Ensure we have an object for non-static methods.
53- if (!$ method ->isStatic () && $ invokeObject === NULL ) {
53+ if (!$ method ->isStatic () && $ invoke_object === NULL ) {
5454 throw new \InvalidArgumentException ("An object instance is required for non-static methods " );
5555 }
5656
57- $ result = $ method ->invokeArgs ($ invokeObject , $ args );
57+ $ result = $ method ->invokeArgs ($ invoke_object , $ args );
5858
5959 // Reset the method's accessibility to its original state.
60- $ method ->setAccessible ($ originalAccessibility );
60+ $ method ->setAccessible ($ original_accessibility );
6161
6262 return $ result ;
6363 }
0 commit comments