Skip to content

Commit bdd4c67

Browse files
committed
Fix TarantoolAdapter
1 parent 2ce81b7 commit bdd4c67

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

dockerfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
if [[ -z "$PHP_IMAGE" ]] ; then
4-
PHP_IMAGE='php:7.3-cli'
4+
PHP_IMAGE='php:7.2-cli'
55
fi
66

77
if [[ -z "$TNT_CLIENT" ]] ; then

src/TarantoolAdapter.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,17 @@ public function __construct(\Tarantool $tarantool)
2222
$this->tarantool = $tarantool;
2323
}
2424

25-
public function call(string $funcName, ...$args) : array
25+
public function call(string $funcName, ...$args)
2626
{
27-
return $this->tarantool->call($funcName, $args);
27+
$result = $this->tarantool->call($funcName, $args);
28+
29+
/*
30+
* The $result can be one of the following:
31+
* 1. An array of tuples, [[id, state, data], ...]
32+
* 2. A scalar value, [[value]]
33+
* 3. An empty array, []
34+
*/
35+
36+
return isset($result[0][1]) ? $result : ($result[0] ?? $result);
2837
}
2938
}

0 commit comments

Comments
 (0)