Skip to content

Commit

Permalink
Format code by the latest cs-fixer. (#6617)
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo authored Mar 23, 2024
1 parent 71b66bd commit e3443e9
Show file tree
Hide file tree
Showing 41 changed files with 51 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\JsonRpc\Listener\RegisterProtocolListener;
Expand Down
4 changes: 3 additions & 1 deletion src/CoreMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Closure;
use Hyperf\HttpServer\Router\Dispatched;
use Hyperf\Rpc\Protocol;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ServerRequestInterface;
use Swow\Psr7\Message\ResponsePlusInterface;
Expand Down Expand Up @@ -44,7 +46,7 @@ protected function handleFound(Dispatched $dispatched, ServerRequestInterface $r

try {
$parameters = $this->parseMethodParameters($controller, $action, $request->getParsedBody());
} catch (\InvalidArgumentException) {
} catch (InvalidArgumentException) {
return $this->responseBuilder->buildErrorResponse($request, ResponseBuilder::INVALID_PARAMS);
}

Expand Down
1 change: 1 addition & 0 deletions src/DataFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Rpc\Context;
Expand Down
1 change: 1 addition & 0 deletions src/DataFormatterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Contract\NormalizerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Exception/BadRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Exception;

use Hyperf\HttpMessage\Exception\BadRequestHttpException;
Expand Down
1 change: 1 addition & 0 deletions src/Exception/ClientException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Exception;

use RuntimeException;
Expand Down
1 change: 1 addition & 0 deletions src/Exception/Handler/HttpExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Exception\Handler;

class HttpExceptionHandler extends TcpExceptionHandler
Expand Down
1 change: 1 addition & 0 deletions src/Exception/Handler/TcpExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Exception\Handler;

use Hyperf\Contract\StdoutLoggerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/HttpCoreMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Psr\Http\Message\ServerRequestInterface;
Expand Down
1 change: 1 addition & 0 deletions src/HttpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Context\RequestContext;
Expand Down
1 change: 1 addition & 0 deletions src/JsonRpcHttpTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use GuzzleHttp\Client;
Expand Down
1 change: 1 addition & 0 deletions src/JsonRpcNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Contract\NormalizerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/JsonRpcPoolTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/JsonRpcTransporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/RegisterProtocolListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Listener;

use Hyperf\Codec\Packer\JsonPacker;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/RegisterServiceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Listener;

use Hyperf\Event\Contract\ListenerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/NormalizeDataFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Contract\NormalizerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Packer/JsonEofPacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Packer;

use Hyperf\Contract\PackerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Packer/JsonLengthPacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Packer;

use Hyperf\Contract\PackerInterface;
Expand Down
1 change: 1 addition & 0 deletions src/PathGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

class PathGenerator extends \Hyperf\Rpc\PathGenerator\PathGenerator
Expand Down
1 change: 1 addition & 0 deletions src/Pool/Frequency.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Pool;

use Hyperf\Pool\Frequency as BaseFrequency;
Expand Down
1 change: 1 addition & 0 deletions src/Pool/PoolFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Pool;

use Hyperf\Di\Container;
Expand Down
7 changes: 4 additions & 3 deletions src/Pool/RpcConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Pool;

use Closure;
Expand Down Expand Up @@ -54,17 +55,17 @@ public function __get($name)
return $this->connection->{$name};
}

public function send(string $data): int|false
public function send(string $data): false|int
{
return $this->connection->sendAll($data);
}

public function recv(float $timeout = 0): string|false
public function recv(float $timeout = 0): false|string
{
return $this->recvPacket($timeout);
}

public function recvPacket(float $timeout = 0): string|false
public function recvPacket(float $timeout = 0): false|string
{
return $this->connection->recvPacket($timeout);
}
Expand Down
1 change: 1 addition & 0 deletions src/Pool/RpcPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc\Pool;

use Hyperf\Contract\ConnectionInterface;
Expand Down
1 change: 1 addition & 0 deletions src/RecvTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Engine\Contract\SocketInterface;
Expand Down
1 change: 1 addition & 0 deletions src/ResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Context\Context;
Expand Down
4 changes: 3 additions & 1 deletion src/TcpServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace Hyperf\JsonRpc;

use Hyperf\Context\ResponseContext;
Expand All @@ -29,6 +30,7 @@
use Hyperf\Server\Exception\InvalidArgumentException;
use Hyperf\Server\ServerManager;
use Psr\Container\ContainerInterface;
use Swoole\Server\Port;
use Swow\Psr7\Message\ResponsePlusInterface;
use Swow\Psr7\Message\ServerRequestPlusInterface;

Expand Down Expand Up @@ -120,7 +122,7 @@ protected function buildJsonRpcRequest(int $fd, int $reactorId, array $data)
if (! isset($data['params'])) {
$data['params'] = [];
}
/** @var \Swoole\Server\Port $port */
/** @var Port $port */
[, $port] = ServerManager::get($this->serverName);

$uri = (new Uri())->setPath($data['method'])->setHost($port->host)->setPort($port->port);
Expand Down
1 change: 1 addition & 0 deletions tests/AnyParamCoreMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Error;
Expand Down
1 change: 1 addition & 0 deletions tests/CoreMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Hyperf\Codec\Packer\JsonPacker;
Expand Down
1 change: 1 addition & 0 deletions tests/DataFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Hyperf\JsonRpc\DataFormatter;
Expand Down
1 change: 1 addition & 0 deletions tests/JsonPackerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Hyperf\JsonRpc\Packer\JsonEofPacker;
Expand Down
1 change: 1 addition & 0 deletions tests/JsonRpcHttpTransporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use GuzzleHttp\Client;
Expand Down
1 change: 1 addition & 0 deletions tests/JsonRpcPoolTransporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Hyperf\Context\ApplicationContext;
Expand Down
1 change: 1 addition & 0 deletions tests/RpcServiceClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc;

use Hyperf\Codec\Packer\JsonPacker;
Expand Down
1 change: 1 addition & 0 deletions tests/Stub/CalculatorProxyServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

use Hyperf\RpcClient\Proxy\AbstractProxyService;
Expand Down
1 change: 1 addition & 0 deletions tests/Stub/CalculatorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

use Error;
Expand Down
1 change: 1 addition & 0 deletions tests/Stub/CalculatorServiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

interface CalculatorServiceInterface
Expand Down
1 change: 1 addition & 0 deletions tests/Stub/IntegerValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

class IntegerValue
Expand Down
5 changes: 3 additions & 2 deletions tests/Stub/RpcConnectionStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

use Closure;
Expand All @@ -29,13 +30,13 @@ public function __get($name)
// return $this->connection->{$name};
}

public function send(string $data): int|false
public function send(string $data): false|int
{
$this->lastData = $data;
return strlen($data);
}

public function recvPacket(float $timeout = 0): string|false
public function recvPacket(float $timeout = 0): false|string
{
return $this->lastData;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Stub/RpcPoolStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/

namespace HyperfTest\JsonRpc\Stub;

use Hyperf\Contract\ConnectionInterface;
Expand Down
Loading

0 comments on commit e3443e9

Please sign in to comment.