Skip to content

这个SDK写得还不如旧版的 #33

@liqunx

Description

@liqunx
  • 自述
    • 首先,一定要自我批评,避免大家攻击我,认为我自以为是:
      大家好,我是一个渣渣,对一部分人来说,我可能是最讨厌的一类人,自述完毕!
  • 问题描述
    emmmmm。。。我不是针对谁,但是一看就是原来程序员离职了,新人(我们称之为“小白”)接手了,完了,这个小白察觉出旧版的弊端:没有命名空间,然后一顿操作猛如虎,新版SDK上线了。。。喜闻乐见,以下代码在SDK中很常见,不是个例,不要认为我鸡蛋里面挑骨头:
    代码链接
/**
     * 添加封禁
     *
     * @param array $Chatroom
     * $Chatroom = [

        ];
     * @return mixed|null
     */
    public function getList(array $Chatroom=[]){
        $conf = $this->conf['getList'];
        $result = (new Request())->Request($conf['url'],$Chatroom);
        $result = (new Utils())->responseError($result, $conf['response']['fail']);
        if($result['code'] == 200){
            $result = (new Utils())->rename($result,['users'=>'members']);
            foreach ($result['members'] as $k=>&$v){
                $v = (new Utils())->rename($v,['userId'=>'id']);
            }
        }
        return $result;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions