Skip to content

Commit

Permalink
rename *Result to *Response
Browse files Browse the repository at this point in the history
  • Loading branch information
pavarnos committed Aug 14, 2018
1 parent 597cc97 commit f14b967
Show file tree
Hide file tree
Showing 29 changed files with 154 additions and 154 deletions.
4 changes: 2 additions & 2 deletions src/Threema/Console/Symfony/AbstractNetworkedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\Response;
use Threema\MsgApi\Connection;
use Threema\MsgApi\Constants;
use Threema\MsgApi\Exceptions\Exception;
Expand All @@ -35,7 +35,7 @@ protected function getConnection(InputInterface $input, OutputInterface $output)
return $this->connectionFactory->getConnection($this->getSenderID($input), $this->getSecret($input, $output));
}

protected function assertSuccess(Result $result)
protected function assertSuccess(Response $result)
{
if ($result->isSuccess()) {
return;
Expand Down
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\CapabilityResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\CapabilityResponse;
use Threema\MsgApi\Commands\Results\Response;

class Capability implements CommandInterface
{
Expand Down Expand Up @@ -42,10 +42,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return CapabilityResult
* @return CapabilityResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new CapabilityResult($httpCode, $response);
return new CapabilityResponse($httpCode, $response);
}
}
6 changes: 3 additions & 3 deletions src/Threema/MsgApi/Commands/CommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\Response;

interface CommandInterface
{
Expand All @@ -25,7 +25,7 @@ public function getParams(): array;
/**
* @param int $httpCode
* @param string $response
* @return Result
* @return Response
*/
public function parseResult(int $httpCode, string $response): Result;
public function parseResult(int $httpCode, string $response): Response;
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/Credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\CreditsResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\CreditsResponse;
use Threema\MsgApi\Commands\Results\Response;

class Credits implements CommandInterface
{
Expand All @@ -29,10 +29,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return CreditsResult
* @return CreditsResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new CreditsResult($httpCode, $response);
return new CreditsResponse($httpCode, $response);
}
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/DownloadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\DownloadFileResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\DownloadFileResponse;
use Threema\MsgApi\Commands\Results\Response;

class DownloadFile implements CommandInterface
{
Expand Down Expand Up @@ -45,10 +45,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return DownloadFileResult
* @return DownloadFileResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new DownloadFileResult($httpCode, $response);
return new DownloadFileResponse($httpCode, $response);
}
}
8 changes: 4 additions & 4 deletions src/Threema/MsgApi/Commands/FetchPublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\FetchPublicKeyResult;
use Threema\MsgApi\Commands\Results\FetchPublicKeyResponse;

class FetchPublicKey implements CommandInterface
{
Expand Down Expand Up @@ -44,10 +44,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return FetchPublicKeyResult
* @return FetchPublicKeyResponse
*/
public function parseResult(int $httpCode, string $response): \Threema\MsgApi\Commands\Results\Result
public function parseResult(int $httpCode, string $response): \Threema\MsgApi\Commands\Results\Response
{
return new FetchPublicKeyResult($httpCode, $response);
return new FetchPublicKeyResponse($httpCode, $response);
}
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/LookupBulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\LookupBulkResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\LookupBulkResponse;
use Threema\MsgApi\Commands\Results\Response;
use Threema\MsgApi\Encryptor\AbstractEncryptor;

/**
Expand Down Expand Up @@ -87,10 +87,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return LookupBulkResult
* @return LookupBulkResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new LookupBulkResult($httpCode, $response, $this);
return new LookupBulkResponse($httpCode, $response, $this);
}
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/LookupEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\LookupIdResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\LookupIdResponse;
use Threema\MsgApi\Commands\Results\Response;

class LookupEmail implements CommandInterface
{
Expand Down Expand Up @@ -65,10 +65,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return LookupIdResult
* @return LookupIdResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new LookupIdResult($httpCode, $response);
return new LookupIdResponse($httpCode, $response);
}
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/LookupPhone.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\LookupIdResult;
use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\LookupIdResponse;
use Threema\MsgApi\Commands\Results\Response;

class LookupPhone implements CommandInterface
{
Expand Down Expand Up @@ -62,10 +62,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return LookupIdResult
* @return LookupIdResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new LookupIdResult($httpCode, $response);
return new LookupIdResponse($httpCode, $response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class CapabilityResult extends Result
class CapabilityResponse extends Response
{
const IMAGE = 'image';
const TEXT = 'text';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class CreditsResult extends Result
class CreditsResponse extends Response
{
/**
* @var int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class DownloadFileResult extends Result
class DownloadFileResponse extends Response
{
/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class FetchPublicKeyResult extends Result
class FetchPublicKeyResponse extends Response
{
/**
* @var string as hex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Threema\MsgApi\Commands\LookupBulk;
use Threema\MsgApi\Helpers\BulkLookupIdentity;

class LookupBulkResult extends Result
class LookupBulkResponse extends Response
{
/** @var \Threema\MsgApi\Commands\LookupBulk */
private $request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class LookupIdResult extends Result
class LookupIdResponse extends Response
{
/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

abstract class Result
abstract class Response
{
/**
* @var int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class SendE2EResult extends Result
class SendE2EResponse extends Response
{
/**
* @var string hex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class SendSimpleResult extends Result
class SendSimpleResponse extends Response
{
/**
* @var string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands\Results;

class UploadFileResult extends Result
class UploadFileResponse extends Response
{
/**
* @var string
Expand Down
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/SendE2E.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\SendE2EResult;
use Threema\MsgApi\Commands\Results\Response;
use Threema\MsgApi\Commands\Results\SendE2EResponse;

class SendE2E implements CommandInterface
{
Expand Down Expand Up @@ -86,10 +86,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return SendE2EResult
* @return SendE2EResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new SendE2EResult($httpCode, $response);
return new SendE2EResponse($httpCode, $response);
}
}
8 changes: 4 additions & 4 deletions src/Threema/MsgApi/Commands/SendSimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\SendSimpleResult;
use Threema\MsgApi\Commands\Results\SendSimpleResponse;

class SendSimple implements CommandInterface
{
Expand Down Expand Up @@ -72,10 +72,10 @@ public function getPath(): string
/**
* @param int $httpCode
* @param string $response
* @return SendSimpleResult
* @return SendSimpleResponse
*/
public function parseResult(int $httpCode, string $response): \Threema\MsgApi\Commands\Results\Result
public function parseResult(int $httpCode, string $response): \Threema\MsgApi\Commands\Results\Response
{
return new SendSimpleResult($httpCode, $response);
return new SendSimpleResponse($httpCode, $response);
}
}
10 changes: 5 additions & 5 deletions src/Threema/MsgApi/Commands/UploadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace Threema\MsgApi\Commands;

use Threema\MsgApi\Commands\Results\Result;
use Threema\MsgApi\Commands\Results\UploadFileResult;
use Threema\MsgApi\Commands\Results\Response;
use Threema\MsgApi\Commands\Results\UploadFileResponse;

class UploadFile implements MultiPartCommandInterface
{
Expand Down Expand Up @@ -53,10 +53,10 @@ public function getData(): string
/**
* @param int $httpCode
* @param string $response
* @return UploadFileResult
* @return UploadFileResponse
*/
public function parseResult(int $httpCode, string $response): Result
public function parseResult(int $httpCode, string $response): Response
{
return new UploadFileResult($httpCode, $response);
return new UploadFileResponse($httpCode, $response);
}
}
Loading

0 comments on commit f14b967

Please sign in to comment.