1 | <?php |
||||
2 | |||||
3 | namespace rOpenDev\Google; |
||||
4 | |||||
5 | class TestProxy |
||||
6 | { |
||||
7 | protected $types; |
||||
8 | |||||
9 | public static function go($proxy) |
||||
10 | { |
||||
11 | $current = new self(); |
||||
12 | |||||
13 | return $current->isPorxyValid($proxy); |
||||
0 ignored issues
–
show
|
|||||
14 | } |
||||
15 | |||||
16 | /** |
||||
17 | * Test si un proxy n'est pas déjà cramé par Google. Si aucun proxy n'est enregistré pour |
||||
18 | * la requête (via setProxy), la fonction test l'IP locale. |
||||
19 | * |
||||
20 | * @return bool |
||||
21 | */ |
||||
22 | public function isProxyValid(?string $proxy = null) |
||||
23 | { |
||||
24 | $keywords = ['bateau', 'avion', 'navire', 'seconde', 'bac', 'piscine', 'fuser', 'place', 'homme', 'femme', 'quad', 'moto', 'velo', |
||||
25 | 'enfant', 'poilu', 'voiture', 'oiseau', 'singe', 'animaux', 'nature', 'paysage', 'jeux', 'maison', 'paysage', 'jardin', ]; |
||||
26 | |||||
27 | $GoogleSerp = new Search($keywords[array_rand($keywords)]); |
||||
28 | $GoogleSerp->setTld('fr')->setLanguage('fr')->setSleep(0)->setNbrPage(1)->setCache(false); |
||||
0 ignored issues
–
show
The call to
rOpenDev\Google\Search::setCache() has too few arguments starting with source .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has less 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. ![]() |
|||||
29 | if ($proxy) { |
||||
30 | $GoogleSerp->setProxy($proxy); |
||||
31 | } |
||||
32 | $r = $GoogleSerp->extractResults(); |
||||
33 | |||||
34 | return false === $r || empty($r) ? false : true; |
||||
35 | } |
||||
36 | } |
||||
37 |
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.