From ef3eb20310561001d0aaa0f77cdcc724b7c2867d Mon Sep 17 00:00:00 2001 From: dmazurek Date: Wed, 28 Mar 2018 20:20:04 +0200 Subject: [PATCH] Transform namespaces to PSR-2 --- examples/custromString.php | 10 +++++----- examples/postInput.php | 8 ++++---- src/{error => Error}/JsonRpcErrorCodes.php | 2 +- src/{exception => Exception}/InvalidParams.php | 4 ++-- .../InvalidRequest.php | 4 ++-- .../JsonRpcException.php | 2 +- .../MethodNotFound.php | 4 ++-- src/{exception => Exception}/ParseError.php | 4 ++-- .../JsonRpcRequestHandler.php | 8 ++++---- .../MethodCallableHandler.php | 18 +++++++++--------- src/{io => IO}/CustomStringInput.php | 6 +++--- src/{io => IO}/InputStream.php | 6 +++--- src/{io => IO}/JsonRpcInput.php | 4 ++-- src/{io => IO}/JsonSerializer.php | 4 ++-- .../IdentifiedJsonRpcRequest.php | 2 +- src/{request => Request}/JsonRpcRequest.php | 2 +- .../JsonRpcRequestAggregate.php | 2 +- .../JsonRpcRequestBuilder.php | 6 +++--- src/{request => Request}/Notification.php | 2 +- src/{request => Request}/Request.php | 2 +- src/{response => Response}/FailedResponse.php | 2 +- src/{response => Response}/JsonRpcResponse.php | 2 +- .../JsonRpcResponseAggregate.php | 2 +- .../NotificationResponse.php | 2 +- src/{response => Response}/Response.php | 2 +- src/{server => Server}/JsonRpcServer.php | 10 +++++----- .../JsonRpcServerIntegrationTest.php | 12 ++++++------ .../InvalidParamsTest.php | 4 ++-- .../InvalidRequestTest.php | 4 ++-- .../MethodNotFoundTest.php | 4 ++-- .../ParseErrorTest.php | 4 ++-- .../MethodCallableHandlerTest.php | 18 +++++++++--------- .../unit/{io => IO}/CustomStringInputTest.php | 6 +++--- tests/unit/{io => IO}/InputStreamTest.php | 6 +++--- tests/unit/{io => IO}/JsonSerializerTest.php | 4 ++-- .../JsonRpcRequestBuilderTest.php | 4 ++-- .../{request => Request}/NotificationTest.php | 2 +- .../unit/{request => Request}/RequestTest.php | 2 +- .../FailedResponseTest.php | 2 +- .../JsonRpcResponseAggregateTest.php | 2 +- .../NotificationResponseTest.php | 2 +- .../{response => Response}/ResponseTest.php | 2 +- .../{server => Server}/JsonRpcServerTest.php | 16 ++++++++-------- 43 files changed, 107 insertions(+), 107 deletions(-) rename src/{error => Error}/JsonRpcErrorCodes.php (86%) rename src/{exception => Exception}/InvalidParams.php (72%) rename src/{exception => Exception}/InvalidRequest.php (73%) rename src/{exception => Exception}/JsonRpcException.php (70%) rename src/{exception => Exception}/MethodNotFound.php (73%) rename src/{exception => Exception}/ParseError.php (72%) rename src/{handler => Handler}/JsonRpcRequestHandler.php (60%) rename src/{handler => Handler}/MethodCallableHandler.php (80%) rename src/{io => IO}/CustomStringInput.php (79%) rename src/{io => IO}/InputStream.php (78%) rename src/{io => IO}/JsonRpcInput.php (50%) rename src/{io => IO}/JsonSerializer.php (82%) rename src/{request => Request}/IdentifiedJsonRpcRequest.php (77%) rename src/{request => Request}/JsonRpcRequest.php (82%) rename src/{request => Request}/JsonRpcRequestAggregate.php (89%) rename src/{request => Request}/JsonRpcRequestBuilder.php (92%) rename src/{request => Request}/Notification.php (94%) rename src/{request => Request}/Request.php (95%) rename src/{response => Response}/FailedResponse.php (94%) rename src/{response => Response}/JsonRpcResponse.php (72%) rename src/{response => Response}/JsonRpcResponseAggregate.php (95%) rename src/{response => Response}/NotificationResponse.php (80%) rename src/{response => Response}/Response.php (93%) rename src/{server => Server}/JsonRpcServer.php (75%) rename tests/unit/{exception => Exception}/InvalidParamsTest.php (82%) rename tests/unit/{exception => Exception}/InvalidRequestTest.php (82%) rename tests/unit/{exception => Exception}/MethodNotFoundTest.php (82%) rename tests/unit/{exception => Exception}/ParseErrorTest.php (82%) rename tests/unit/{handler => Handler}/MethodCallableHandlerTest.php (88%) rename tests/unit/{io => IO}/CustomStringInputTest.php (85%) rename tests/unit/{io => IO}/InputStreamTest.php (86%) rename tests/unit/{io => IO}/JsonSerializerTest.php (92%) rename tests/unit/{request => Request}/JsonRpcRequestBuilderTest.php (96%) rename tests/unit/{request => Request}/NotificationTest.php (93%) rename tests/unit/{request => Request}/RequestTest.php (94%) rename tests/unit/{response => Response}/FailedResponseTest.php (94%) rename tests/unit/{response => Response}/JsonRpcResponseAggregateTest.php (98%) rename tests/unit/{response => Response}/NotificationResponseTest.php (88%) rename tests/unit/{response => Response}/ResponseTest.php (93%) rename tests/unit/{server => Server}/JsonRpcServerTest.php (89%) diff --git a/examples/custromString.php b/examples/custromString.php index a513daa..4bc0a13 100644 --- a/examples/custromString.php +++ b/examples/custromString.php @@ -3,11 +3,11 @@ declare(strict_types=1); use DawidMazurek\JsonRpc\handler\MethodCallableHandler; -use DawidMazurek\JsonRpc\io\CustomStringInput; -use DawidMazurek\JsonRpc\io\InputStream; -use DawidMazurek\JsonRpc\io\JsonSerializer; -use DawidMazurek\JsonRpc\request\JsonRpcRequestBuilder; -use DawidMazurek\JsonRpc\server\JsonRpcServer; +use DawidMazurek\JsonRpc\IO\CustomStringInput; +use DawidMazurek\JsonRpc\IO\InputStream; +use DawidMazurek\JsonRpc\IO\JsonSerializer; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestBuilder; +use DawidMazurek\JsonRpc\Server\JsonRpcServer; include __DIR__ . '/../vendor/autoload.php'; $requestBuilder = new JsonRpcRequestBuilder(new JsonSerializer()); diff --git a/examples/postInput.php b/examples/postInput.php index b2d7e25..ee69e5e 100644 --- a/examples/postInput.php +++ b/examples/postInput.php @@ -3,10 +3,10 @@ declare(strict_types=1); use DawidMazurek\JsonRpc\handler\MethodCallableHandler; -use DawidMazurek\JsonRpc\io\InputStream; -use DawidMazurek\JsonRpc\io\JsonSerializer; -use DawidMazurek\JsonRpc\request\JsonRpcRequestBuilder; -use DawidMazurek\JsonRpc\server\JsonRpcServer; +use DawidMazurek\JsonRpc\IO\InputStream; +use DawidMazurek\JsonRpc\IO\JsonSerializer; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestBuilder; +use DawidMazurek\JsonRpc\Server\JsonRpcServer; include __DIR__ . '/../vendor/autoload.php'; $requestBuilder = new JsonRpcRequestBuilder(new JsonSerializer()); diff --git a/src/error/JsonRpcErrorCodes.php b/src/Error/JsonRpcErrorCodes.php similarity index 86% rename from src/error/JsonRpcErrorCodes.php rename to src/Error/JsonRpcErrorCodes.php index b0bbecc..26356b5 100644 --- a/src/error/JsonRpcErrorCodes.php +++ b/src/Error/JsonRpcErrorCodes.php @@ -2,7 +2,7 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\error; +namespace DawidMazurek\JsonRpc\Error; class JsonRpcErrorCodes { diff --git a/src/exception/InvalidParams.php b/src/Exception/InvalidParams.php similarity index 72% rename from src/exception/InvalidParams.php rename to src/Exception/InvalidParams.php index 6ec4e7a..69b1ac8 100644 --- a/src/exception/InvalidParams.php +++ b/src/Exception/InvalidParams.php @@ -2,9 +2,9 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\exception; +namespace DawidMazurek\JsonRpc\Exception; -use DawidMazurek\JsonRpc\error\JsonRpcErrorCodes; +use DawidMazurek\JsonRpc\Error\JsonRpcErrorCodes; class InvalidParams extends JsonRpcException { diff --git a/src/exception/InvalidRequest.php b/src/Exception/InvalidRequest.php similarity index 73% rename from src/exception/InvalidRequest.php rename to src/Exception/InvalidRequest.php index 5327d6d..7127419 100644 --- a/src/exception/InvalidRequest.php +++ b/src/Exception/InvalidRequest.php @@ -2,9 +2,9 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\exception; +namespace DawidMazurek\JsonRpc\Exception; -use DawidMazurek\JsonRpc\error\JsonRpcErrorCodes; +use DawidMazurek\JsonRpc\Error\JsonRpcErrorCodes; class InvalidRequest extends JsonRpcException { diff --git a/src/exception/JsonRpcException.php b/src/Exception/JsonRpcException.php similarity index 70% rename from src/exception/JsonRpcException.php rename to src/Exception/JsonRpcException.php index 5af1b0e..c8755c7 100644 --- a/src/exception/JsonRpcException.php +++ b/src/Exception/JsonRpcException.php @@ -2,7 +2,7 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\exception; +namespace DawidMazurek\JsonRpc\Exception; use Exception; diff --git a/src/exception/MethodNotFound.php b/src/Exception/MethodNotFound.php similarity index 73% rename from src/exception/MethodNotFound.php rename to src/Exception/MethodNotFound.php index 05e915d..f67ea8c 100644 --- a/src/exception/MethodNotFound.php +++ b/src/Exception/MethodNotFound.php @@ -2,9 +2,9 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\exception; +namespace DawidMazurek\JsonRpc\Exception; -use DawidMazurek\JsonRpc\error\JsonRpcErrorCodes; +use DawidMazurek\JsonRpc\Error\JsonRpcErrorCodes; class MethodNotFound extends JsonRpcException { diff --git a/src/exception/ParseError.php b/src/Exception/ParseError.php similarity index 72% rename from src/exception/ParseError.php rename to src/Exception/ParseError.php index 98478eb..292d7a0 100644 --- a/src/exception/ParseError.php +++ b/src/Exception/ParseError.php @@ -2,9 +2,9 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\exception; +namespace DawidMazurek\JsonRpc\Exception; -use DawidMazurek\JsonRpc\error\JsonRpcErrorCodes; +use DawidMazurek\JsonRpc\Error\JsonRpcErrorCodes; class ParseError extends JsonRpcException { diff --git a/src/handler/JsonRpcRequestHandler.php b/src/Handler/JsonRpcRequestHandler.php similarity index 60% rename from src/handler/JsonRpcRequestHandler.php rename to src/Handler/JsonRpcRequestHandler.php index 5ee1f6c..1149789 100644 --- a/src/handler/JsonRpcRequestHandler.php +++ b/src/Handler/JsonRpcRequestHandler.php @@ -2,11 +2,11 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\handler; +namespace DawidMazurek\JsonRpc\Handler; -use DawidMazurek\JsonRpc\exception\JsonRpcException; -use DawidMazurek\JsonRpc\request\JsonRpcRequest; -use DawidMazurek\JsonRpc\response\JsonRpcResponse; +use DawidMazurek\JsonRpc\Exception\JsonRpcException; +use DawidMazurek\JsonRpc\Request\JsonRpcRequest; +use DawidMazurek\JsonRpc\Response\JsonRpcResponse; interface JsonRpcRequestHandler { diff --git a/src/handler/MethodCallableHandler.php b/src/Handler/MethodCallableHandler.php similarity index 80% rename from src/handler/MethodCallableHandler.php rename to src/Handler/MethodCallableHandler.php index 1bbc224..d931ffb 100644 --- a/src/handler/MethodCallableHandler.php +++ b/src/Handler/MethodCallableHandler.php @@ -2,16 +2,16 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\handler; +namespace DawidMazurek\JsonRpc\Handler; -use DawidMazurek\JsonRpc\exception\JsonRpcException; -use DawidMazurek\JsonRpc\exception\MethodNotFound; -use DawidMazurek\JsonRpc\request\JsonRpcRequest; -use DawidMazurek\JsonRpc\request\Request; -use DawidMazurek\JsonRpc\response\FailedResponse; -use DawidMazurek\JsonRpc\response\JsonRpcResponse; -use DawidMazurek\JsonRpc\response\NotificationResponse; -use DawidMazurek\JsonRpc\response\Response; +use DawidMazurek\JsonRpc\Exception\JsonRpcException; +use DawidMazurek\JsonRpc\Exception\MethodNotFound; +use DawidMazurek\JsonRpc\Request\JsonRpcRequest; +use DawidMazurek\JsonRpc\Request\Request; +use DawidMazurek\JsonRpc\Response\FailedResponse; +use DawidMazurek\JsonRpc\Response\JsonRpcResponse; +use DawidMazurek\JsonRpc\Response\NotificationResponse; +use DawidMazurek\JsonRpc\Response\Response; class MethodCallableHandler implements JsonRpcRequestHandler { diff --git a/src/io/CustomStringInput.php b/src/IO/CustomStringInput.php similarity index 79% rename from src/io/CustomStringInput.php rename to src/IO/CustomStringInput.php index 3f47307..e9e1028 100644 --- a/src/io/CustomStringInput.php +++ b/src/IO/CustomStringInput.php @@ -2,10 +2,10 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\io; +namespace DawidMazurek\JsonRpc\IO; -use DawidMazurek\JsonRpc\request\JsonRpcRequestAggregate; -use DawidMazurek\JsonRpc\request\JsonRpcRequestBuilder; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestAggregate; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestBuilder; class CustomStringInput implements JsonRpcInput { diff --git a/src/io/InputStream.php b/src/IO/InputStream.php similarity index 78% rename from src/io/InputStream.php rename to src/IO/InputStream.php index 293c495..50ecc78 100644 --- a/src/io/InputStream.php +++ b/src/IO/InputStream.php @@ -2,10 +2,10 @@ declare(strict_types = 1); -namespace DawidMazurek\JsonRpc\io; +namespace DawidMazurek\JsonRpc\IO; -use DawidMazurek\JsonRpc\request\JsonRpcRequestAggregate; -use DawidMazurek\JsonRpc\request\JsonRpcRequestBuilder; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestAggregate; +use DawidMazurek\JsonRpc\Request\JsonRpcRequestBuilder; class InputStream implements JsonRpcInput { diff --git a/src/io/JsonRpcInput.php b/src/IO/JsonRpcInput.php similarity index 50% rename from src/io/JsonRpcInput.php rename to src/IO/JsonRpcInput.php index 151a7b4..7392480 100644 --- a/src/io/JsonRpcInput.php +++ b/src/IO/JsonRpcInput.php @@ -1,8 +1,8 @@