Issues (584)

tests/github-api.php (2 issues)

Labels
Severity
1
<?php
2
/*
3
require __DIR__ . '/Github/exceptions.php';
4
require __DIR__ . '/Github/Sanity.php';
5
require __DIR__ . '/Github/Helpers.php';
6
7
require __DIR__ . '/Github/Storages/ICache.php';
8
require __DIR__ . '/Github/Storages/ISessionStorage.php';
9
require __DIR__ . '/Github/Http/IClient.php';
10
11
require __DIR__ . '/Github/Storages/FileCache.php';
12
require __DIR__ . '/Github/Storages/SessionStorage.php';
13
14
require __DIR__ . '/Github/Http/Message.php';
15
require __DIR__ . '/Github/Http/Request.php';
16
require __DIR__ . '/Github/Http/Response.php';
17
require __DIR__ . '/Github/Http/CachedClient.php';
18
require __DIR__ . '/Github/Http/AbstractClient.php';
19
require __DIR__ . '/Github/Http/CurlClient.php';
20
require __DIR__ . '/Github/Http/StreamClient.php';
21
22
require __DIR__ . '/Github/OAuth/Configuration.php';
23
require __DIR__ . '/Github/OAuth/Token.php';
24
require __DIR__ . '/Github/OAuth/Login.php';
25
26
require __DIR__ . '/Github/Api.php';
27
require __DIR__ . '/Github/Paginator.php';
28
*/
29
30
use XoopsModules\Wggithub;
31
use XoopsModules\Wggithub\Github;
32
33
require __DIR__ . '/header.php';
34
// It recovered the value of argument op in URL$
35
36
/*
37
$data = [];
38
$api = new Github\Api;
39
$response = $api->get('/emojis');
40
$data = $api->decode($response);
41
foreach ($data as $emoji) {
42
    echo '<img src="' . $emoji . '">';
43
}
44
*/
45
46
$data = [];
47
$url = '/orgs/XoopsModules25x/repos?per_page=100&page=1';
48
echo "<br>Test read org repo:" . $url;
49
$api = new \XoopsModules\Wggithub\Github\GithubClient();
50
$data = $api->testMilo($url);
0 ignored issues
show
The method testMilo() does not exist on XoopsModules\Wggithub\Github\GithubClient. ( Ignorable by Annotation )

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

50
$data = $api->/** @scrutinizer ignore-call */ testMilo($url);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
51
$count = 0;
52
foreach ($data as $key => $repo) {
53
    echo "<br>key:" . $key . ' repo:' . $repo['name'];
54
    $count++;
55
    if ($count>5) {break;}
56
}
57
58
59
$data = [];
60
$url = '/users/ggoffy/repos?per_page=100&page=1';
61
echo "<br><br>Test read user repo:" . $url;
62
$api = new \XoopsModules\Wggithub\Github\GithubClient();
63
$data = $api->testMilo($url);
64
$count = 0;
65
foreach ($data as $key => $repo) {
66
    echo "<br>key:" . $key . ' repo:' . $repo['name'];
67
    $count++;
68
    if ($count>5) {break;}
69
}
70
71
72
$data = [];
73
$url = '/repos/XoopsModules25x/smallworld/readme';
74
echo "<br><br>test read readme orgs:" . $url;
75
$api = new \XoopsModules\Wggithub\Github\GithubClient();
76
$data = $api->testMilo($url);
77
echo '<br>name:' . $data['name'];
78
echo '<br>download_url:' . $data['download_url'];
79
80
81
$data = [];
82
$url = '/repos/ggoffy/wggithub/readme';
83
echo "<br><br>test read readme user:" . $url;
84
$api = new \XoopsModules\Wggithub\Github\GithubClient();
85
$data = $api->testMilo($url);
86
echo '<br>name:' . $data['name'];
87
echo '<br>download_url:' . $data['download_url'];
88
89
90
echo "<br><br><br>-----------------------------------";
91
echo "<br>testMilo2";
92
echo "<br>-----------------------------------";
93
94
$data = [];
95
$url = '/orgs/XoopsModules25x/repos?per_page=100&page=1';
96
echo "<br>Test read org repo:" . $url;
97
$api = new \XoopsModules\Wggithub\Github\GithubClient();
98
$data = $api->testMilo2($url);
0 ignored issues
show
The method testMilo2() does not exist on XoopsModules\Wggithub\Github\GithubClient. ( Ignorable by Annotation )

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

98
$data = $api->/** @scrutinizer ignore-call */ testMilo2($url);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
99
$count = 0;
100
foreach ($data as $key => $repo) {
101
    echo "<br>key:" . $key . ' repo:' . $repo['name'];
102
    $count++;
103
    if ($count>5) {break;}
104
}
105
106
107
$data = [];
108
$url = '/users/ggoffy/repos?per_page=100&page=1';
109
echo "<br><br>Test read user repo:" . $url;
110
$api = new \XoopsModules\Wggithub\Github\GithubClient();
111
$data = $api->testMilo2($url);
112
$count = 0;
113
foreach ($data as $key => $repo) {
114
    echo "<br>key:" . $key . ' repo:' . $repo['name'];
115
    $count++;
116
    if ($count>5) {break;}
117
}
118
119
120
$data = [];
121
$url = '/repos/XoopsModules25x/smallworld/readme';
122
echo "<br><br>test read readme orgs:" . $url;
123
$api = new \XoopsModules\Wggithub\Github\GithubClient();
124
$data = $api->testMilo2($url);
125
echo '<br>name:' . $data['name'];
126
echo '<br>download_url:' . $data['download_url'];
127
128
129
$data = [];
130
$url = '/repos/ggoffy/wggithub/readme';
131
echo "<br><br>test read readme user:" . $url;
132
$api = new \XoopsModules\Wggithub\Github\GithubClient();
133
$data = $api->testMilo2($url);
134
echo '<br>name:' . $data['name'];
135
echo '<br>download_url:' . $data['download_url'];
136
137
138