Skip to content

Commit bf26867

Browse files
committed
v1.3.0
1 parent 6925210 commit bf26867

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

src/RedisClient/Pipeline/Version/Pipeline3x2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@
278278
* @method Pipeline3x2 geodist($key, $member1, $member2, $unit = null)
279279
* @method Pipeline3x2 geohash($key, $members)
280280
* @method Pipeline3x2 geopos($key, $members)
281+
* @method Pipeline3x2 georadius($key, $longitude, $latitude, $radius, $unit, $withcoord = false, $withdist = false, $withhash = false, $count = null, $asc = null, $storeKey = null, $storeDist = false)
282+
* @method Pipeline3x2 georadiusbymember($key, $member, $radius, $unit, $withcoord = false, $withdist = false, $withhash = false, $count = null, $asc = null, $storeKey = null, $storeDist = false)
281283
* @method Pipeline3x2 geodel($key, $members)
282284
*
283285
* Hashes

tools/generate_annotations_for_pipeline.php

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,48 @@
2020
}
2121

2222
$lines = `grep -r 'public function' ./src/RedisClient/Command/Traits/`;
23+
$lines = explode("\n", $lines);
24+
$files = [];
2325

24-
//Version3x0/SortedSetsCommandsTrait.php: public function zrange($key, $start, $stop, $withscores = false)
25-
if (!preg_match_all('/Version(\d+x\d+)\/(\w+)CommandsTrait\.php.+public function (.+)\((.*)\)/im', $lines, $matches, PREG_SET_ORDER)) {
26-
echo 'Not found'. EOL;
26+
foreach ($lines as $line) {
27+
$l = explode(':', $line, 2);
28+
if (!$l[0]) {
29+
continue;
30+
}
31+
if (!preg_match('/Version(\d+x\d+)\/(\w+)CommandsTrait\.php/i', $l[0])) {
32+
continue;
33+
}
34+
$files[] = $l[0];
2735
}
36+
$files = array_unique($files);
37+
$matches = [];
38+
39+
foreach ($files as $file) {
40+
if (!preg_match('/Version(\d+x\d+)\/(\w+)CommandsTrait\.php/i', $file, $mfile)) {
41+
continue;
42+
}
43+
44+
$f = file_get_contents($file);
45+
46+
if (!preg_match_all('/public function (.+)\s*\(([^)]*)\)/im', $f, $mfunc, PREG_SET_ORDER)) {
47+
continue;
48+
}
49+
50+
foreach ($mfunc as $mf) {
51+
$matches[] = [
52+
$mfile[0],
53+
$mfile[1],
54+
$mfile[2],
55+
$mf[1],
56+
preg_replace("/\\s*\n\\s*/", ' ', trim($mf[2]))
57+
];
58+
}
59+
}
60+
61+
//Version3x0/SortedSetsCommandsTrait.php: public function zrange($key, $start, $stop, $withscores = false)
62+
//if (!preg_match_all('/Version(\d+x\d+)\/(\w+)CommandsTrait\.php.+public function (.+)\((.*)\)/im', $lines, $matches, PREG_SET_ORDER)) {
63+
// echo 'Not found'. EOL;
64+
//}
2865

2966
$versions = [];
3067

0 commit comments

Comments
 (0)