Issues (33)

src/Source/Client.php (3 issues)

Severity
1
<?php
2
3
namespace Freyo\MtaH5\Source;
4
5
use Freyo\MtaH5\Kernel\BaseClient;
6
7
class Client extends BaseClient
8
{
9
    /**
10
     * 按天查询外部同站链接带来的流量情情况.
11
     *
12
     * @see https://mta.qq.com/docs/h5_api.html#%E5%A4%96%E9%83%A8%E9%93%BE%E6%8E%A5
13
     *
14
     * @param string       $startDate 开始时间(Y-m-d)
15
     * @param string       $endDate   结束时间(Y-m-d)
16
     * @param array|string $urls      url地址
17
     *
18
     * @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException
19
     *
20
     * @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
21
     */
22
    public function query($startDate, $endDate, $urls)
23
    {
24
        $params = [
25
            'start_date' => $startDate,
26
            'end_date'   => $endDate,
27
            'urls'       => implode((array) $urls, ','),
0 ignored issues
show
The call to implode() has too many arguments starting with ','. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
            'urls'       => /** @scrutinizer ignore-call */ implode((array) $urls, ','),

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
28
            'idx'        => 'pv,uv,vv,iv',
29
        ];
30
31
        return $this->httpGet('ctr_source_out', $params);
32
    }
33
34
    /**
35
     * 按天查询用户最后访问的进入次数与跳出率.
36
     *
37
     * @see https://mta.qq.com/docs/h5_api.html#%E5%85%A5%E5%8F%A3%E9%A1%B5%E9%9D%A2
38
     *
39
     * @param string       $startDate 开始时间(Y-m-d)
40
     * @param string       $endDate   结束时间(Y-m-d)
41
     * @param array|string $urls      url地址
42
     *
43
     * @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException
44
     *
45
     * @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
46
     */
47
    public function land($startDate, $endDate, $urls)
48
    {
49
        $params = [
50
            'start_date' => $startDate,
51
            'end_date'   => $endDate,
52
            'urls'       => implode((array) $urls, ','),
0 ignored issues
show
The call to implode() has too many arguments starting with ','. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

52
            'urls'       => /** @scrutinizer ignore-call */ implode((array) $urls, ','),

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
53
            'idx'        => 'pv,uv,vv,iv',
54
        ];
55
56
        return $this->httpGet('ctr_page_land', $params);
57
    }
58
59
    /**
60
     * 按天查询最后访问页面的离次数.
61
     *
62
     * @see https://mta.qq.com/docs/h5_api.html#%E7%A6%BB%E5%BC%80%E9%A1%B5%E9%9D%A2
63
     *
64
     * @param string $startDate 开始时间(Y-m-d)
65
     * @param string $endDate   结束时间(Y-m-d)
66
     * @param array  $urls      url地址
67
     *
68
     * @throws \Freyo\MtaH5\Kernel\Exceptions\InvalidConfigException
69
     *
70
     * @return array|\Freyo\MtaH5\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string
71
     */
72
    public function leave($startDate, $endDate, $urls)
73
    {
74
        $params = [
75
            'start_date' => $startDate,
76
            'end_date'   => $endDate,
77
            'urls'       => implode((array) $urls, ','),
0 ignored issues
show
The call to implode() has too many arguments starting with ','. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

77
            'urls'       => /** @scrutinizer ignore-call */ implode((array) $urls, ','),

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
78
            'idx'        => 'pv,uv,vv,iv',
79
        ];
80
81
        return $this->httpGet('ctr_page_exit', $params);
82
    }
83
}
84