Skip to content

Commit

Permalink
Merge pull request #34 from jlaso/hotfix/exception-does-not-return-st…
Browse files Browse the repository at this point in the history
…arndard-block

fixed the exception method in order to return a standard block
  • Loading branch information
jlaso committed Feb 14, 2018
2 parents 90da98a + 33138fc commit 34a8504
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions src/JLaso/TranslationsBundle/Command/ServerMongoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace JLaso\TranslationsBundle\Command;

/**
/*
*
*
* {"command":"key index", "key":"1234", "secret":1234, "project_id":1, ...}
Expand All @@ -12,6 +12,7 @@
*
*
*/

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManager;
use Doctrine\ODM\MongoDB\DocumentManager;
Expand Down Expand Up @@ -85,7 +86,7 @@ class ServerMongoCommand extends ContainerAwareCommand
protected $lzfUse = true;

/**
* configure the command that starts the server
* configure the command that starts the server.
*/
protected function configure()
{
Expand All @@ -98,7 +99,7 @@ protected function configure()
}

/**
* Atomic send of a string trough the socket
* Atomic send of a string trough the socket.
*
* @param $msg
*
Expand All @@ -112,7 +113,7 @@ protected function send($msg)
}

/**
* Reads the socket
* Reads the socket.
*
* @param bool $compress
*
Expand Down Expand Up @@ -183,7 +184,7 @@ protected function readSocket($compress = true)
}

/**
* Body of the command
* Body of the command.
*
* @param InputInterface $input
* @param OutputInterface $output
Expand Down Expand Up @@ -233,7 +234,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($buf) {
try {
$read = json_decode($buf, true);
/**
/*
* fixed or not data that comes with the data received
*/
$command = isset($read['command']) ? $read['command'] : '';
Expand Down Expand Up @@ -366,7 +367,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
exit;

default:
$this->exception(sprintf('command \'%s\' unknow', $command));
$this->exception(sprintf('command \'%s\' unknown', $command));
break;
}
} catch (\Exception $e) {
Expand Down Expand Up @@ -565,7 +566,7 @@ protected function exception($reason)
print $result;
}

return $this->send($result);
return $this->sendMessage($result);
}

protected function prettySize($size)
Expand Down Expand Up @@ -623,7 +624,7 @@ protected function validateRequest($buffer)
}

/**
* Devuelve los detalles de un mensaje en concreto
* Devuelve los detalles de un mensaje en concreto.
*/
public function getTranslationDetails(Project $project, $bundle, $key, $language, $catalog = RestController::DEFAULT_CATALOG)
{
Expand Down Expand Up @@ -660,8 +661,7 @@ public function getTranslationDetails(Project $project, $bundle, $key, $language
}

/**
* Devuelve los mensajes de una key
*
* Devuelve los mensajes de una key.
*/
public function getTranslations(Project $project, $bundle, $key, $catalog)
{
Expand Down Expand Up @@ -692,7 +692,7 @@ public function getTranslations(Project $project, $bundle, $key, $catalog)
}

/**
* Devuelve el comentario de una key
* Devuelve el comentario de una key.
*/
protected function getComment(Project $project, $bundle, $key, $catalog)
{
Expand Down Expand Up @@ -876,15 +876,13 @@ protected function getTranslatableDocumentRepository()
}

/**
*
* $data[key][locale]
* {
* message,
* updatedAt,
* bundle,
* fileName,
* }
*
* }.
*/
protected function receiveKeys(Project $project, $catalog, $data)
{
Expand Down Expand Up @@ -1006,13 +1004,11 @@ protected function receiveKeys(Project $project, $catalog, $data)
}

/**
*
* $data[key][locale]
* {
* message,
* updatedAt
* }
*
* }.
*/
protected function sendKeys(Project $project, $catalog)
{
Expand Down

0 comments on commit 34a8504

Please sign in to comment.