Code Duplication    Length = 8-9 lines in 3 locations

src/Agents/ALiYunAgent.php 1 location

@@ 26-33 (lines=8) @@
23
        $this->transformConfig();
24
    }
25
26
    protected function transformConfig()
27
    {
28
        $credentials = Arr::pull($this->config, 'credentials');
29
        $this->appKey = Arr::pull($credentials, 'appKey');
30
        $this->appSecret = Arr::pull($credentials, 'appSecret');
31
        $this->setSignName();
32
        $this->setTemplateId(Arr::pull($this->config, 'templateId'));
33
    }
34
35
    protected function percentEncode($str)
36
    {

src/Agents/QQYunAgent.php 1 location

@@ 24-32 (lines=9) @@
21
        $this->transformConfig();
22
    }
23
24
    protected function transformConfig()
25
    {
26
        $credentials = Arr::pull($this->config, 'credentials');
27
        $this->appId = Arr::pull($credentials, 'appId');
28
        $this->appKey = Arr::pull($credentials, 'appKey');
29
        $this->setSignName();
30
        $this->setTemplateId(Arr::pull($this->config, 'templateId'));
31
        $this->strRand = $this->makeRandom();
32
    }
33
34
    private function computeSignature($parameters)
35
    {

src/Agents/SubMailAgent.php 1 location

@@ 25-32 (lines=8) @@
22
        $this->transformConfig();
23
    }
24
25
    protected function transformConfig()
26
    {
27
        $credentials = Arr::pull($this->config, 'credentials');
28
        $this->appId = Arr::pull($credentials, 'appid');
29
        $this->apiKey = Arr::pull($credentials, 'apiKey');
30
        $this->setTemplateId(Arr::pull($this->config, 'templateId'));
31
        $this->setSignName();
32
    }
33
34
    public function singlesSend($mobile, $send = true)
35
    {