src/JsonRpc.php
private function serviceDescription($object) {
        $class_name = get_class($object);
        $methods = get_class_methods($class_name);
        $service = ["sdversion" => "1.0",
                    "name" => "DemoService",
                    "address" => $this->currentURL(),
                    "id" => "urn:md5:" . md5($this->currentURL())];
        $static = get_class_vars($class_name);
        foreach ($methods as $method_name) {
            $proc = array("name" => $method_name);
            $method = new \ReflectionMethod($class_name, $method_name);
            $params = array();
            foreach ($method->getParameters() as $param) {
                $params[] = $param->name;
            }
            $proc['params'] = $params;
            $help_str_name = $method_name . "_documentation";
            if (array_key_exists($help_str_name, $static)) {
                $proc['help'] = $static[$help_str_name];
            }
            $service['procs'][] = $proc;
        }
        return $service;
    }
private function serviceDescription($object) {
        $class_name = get_class($object);
        $methods = get_class_methods($class_name);
        $service = ["sdversion" => "1.0",
                    "name" => "DemoService",
                    "address" => $this->currentURL(),
                    "id" => "urn:md5:" . md5($this->currentURL())];
        $static = get_class_vars($class_name);
        foreach ($methods as $method_name) {
            $proc = array("name" => $method_name);
            $method = new \ReflectionMethod($class_name, $method_name);
            $params = array();
            foreach ($method->getParameters() as $param) {
                $params[] = $param->name;
            }
            $proc['params'] = $params;
            $help_str_name = $method_name . "_documentation";
            if (array_key_exists($help_str_name, $static)) {
                $proc['help'] = $static[$help_str_name];
            }
            $service['procs'][] = $proc;
        }
        return $service;
    }
private function serviceDescription ( $ object ) { $ class_name = get_class ( $ object ) ; $ methods = get_class_methods ( $ class_name ) ; $ service = [ "sdversion" => "1.0" , "name" => "DemoService" , "address" => $ this -> currentURL ( ) , "id" => "urn:md5:" . md5 ( $ this -> currentURL ( ) ) ] ; $ static = get_class_vars ( $ class_name ) ; foreach ( $ methods as $ method_name ) { $ proc = array ( "name" => $ method_name ) ; $ method = new \ ReflectionMethod ( $ class_name , $ method_name ) ; $ params = array ( ) ; foreach ( $ method -> getParameters ( ) as $ param ) { $ params [ ] = $ param -> name ; } $ proc [ 'params' ] = $ params ; $ help_str_name = $ method_name . "_documentation" ; if ( array_key_exists ( $ help_str_name , $ static ) ) { $ proc [ 'help' ] = $ static [ $ help_str_name ] ; } $ service [ 'procs' ] [ ] = $ proc ; } return $ service ; }
get service description of the class
@param object $object
@return array
get service description of the class