private function generateMethodCode(\ReflectionMethod $rm) : array
    {
        $method_name     = $rm->getName();
        $modifiers       = $rm->getModifiers();
        $params          = $rm->getParameters();
        $has_return_type = $rm->hasReturnType();
        $return_type     = $rm->getReturnType();
        
        $is_static = Util::isAllBitSet($modifiers, \ReflectionMethod::IS_STATIC);
        
        // method body
        $method_body = '';
        if ($has_return_type){
            // pseudo code with return value
            $method_body .= 'return ' . self::generatePseudoReturnCode($return_type) . ';';
        }
    
        // generate code
        $parameters_code = [];
        foreach($params as $rp){
            $parameters_code[] = self::generateParameterPrototypeCode($rp);
        }
        $parameters_code = implode(', ', $parameters_code);
        
        $return_type_part = '';
        if ($has_return_type){
            $return_type_part .= ' : ';
            $return_type_part .= self::generateReturnTypeCode($return_type);
        }
        
        $prototype = Code::PHP_PUBLIC . ' ' . ($is_static ? Code::PHP_STATIC . ' ' : '') . Code::PHP_FUNCTION . ' '
                        . $method_name . '(' . $parameters_code . ')' . $return_type_part;
        
        $code[] = Code::INDENT . $prototype;
        $code[] = Code::INDENT . '{';
        if (!empty($method_body)){
            $code[] = Code::INDENT . Code::INDENT . $method_body;
        }
        $code[] = Code::INDENT . '}';
        
        return $code;
    }