Skip to content

Commit

Permalink
Merge pull request #10 from fcastilloes/type-catalog
Browse files Browse the repository at this point in the history
Fix sending params to runtime call
  • Loading branch information
fcastilloes committed Apr 28, 2017
2 parents 1fbe4ae + ac42fb5 commit 26585d0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.2] - 2017-04-28
### Changed
- Fixed sending params to runtime call

## [1.0.1] - 2017-04-07
### Changed
- Fixed type hints and namespacing
Expand Down
4 changes: 2 additions & 2 deletions src/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function complete(string $action, array $params = []): Action;
* @param Param[] $params
* @param File[] $files
* @param int $timeout
* @return Action
* @return mixed
*/
public function call(
string $service,
Expand All @@ -177,7 +177,7 @@ public function call(
array $params = [],
array $files = [],
int $timeout = 1000
): Action;
);

/**
* @param string $service
Expand Down
5 changes: 2 additions & 3 deletions src/Api/ActionApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public function complete(string $action, array $params = []): Action
* @param array $params
* @param array $files
* @param int $timeout
* @return Action
* @return mixed
*/
public function call(
string $service,
Expand All @@ -386,8 +386,7 @@ public function call(
array $params = [],
array $files = [],
int $timeout = 1000
): Action
{
) {
$address = 'ipc://@katana-' . preg_replace(
'/[^a-zA-Z0-9-]/',
'-',
Expand Down
2 changes: 1 addition & 1 deletion src/Mapper/CompactTransportMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ public function merge(Transport $transport, array $mergeData)
}

// Merge Body
if (!$transport->hasBody()) {
if (!$transport->hasBody() && $mergeData['b']) {
$transport->setBody(new File(
'body',
$mergeData['b']['p'],
Expand Down
15 changes: 14 additions & 1 deletion src/Messaging/RuntimeCaller/ZeroMQRuntimeCaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ class ZeroMQRuntimeCaller
*/
private $mapper;

/**
* @param Param $param
* @return array
*/
private function writeParam(Param $param)
{
return [
'n' => $param->getName(),
'v' => $param->getValue(),
't' => $param->getType(),
];
}

/**
* @param MessagePackSerializer $serializer
* @param CompactTransportMapper $mapper
Expand Down Expand Up @@ -89,7 +102,7 @@ public function call(
$target->getAction()
],
'T' => $this->mapper->writeTransport($transport),
'p' => $params,
'p' => array_map([$this, 'writeParam'], $params),
'f' => $files,
],
],
Expand Down

0 comments on commit 26585d0

Please sign in to comment.