Skip to content

Commit

Permalink
Merge pull request #16 from DawidMazurek/psr-2-namespaces
Browse files Browse the repository at this point in the history
Transform namespaces to PSR-2
  • Loading branch information
DawidMazurek authored Mar 28, 2018
2 parents 886d7a3 + ef3eb20 commit ec45f51
Show file tree
Hide file tree
Showing 43 changed files with 107 additions and 107 deletions.
10 changes: 5 additions & 5 deletions examples/custromString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 4 additions & 4 deletions examples/postInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\error;
namespace DawidMazurek\JsonRpc\Error;

class JsonRpcErrorCodes
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\exception;
namespace DawidMazurek\JsonRpc\Exception;

use Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/exception/ParseError.php → src/Exception/ParseError.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/io/CustomStringInput.php → src/IO/CustomStringInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/io/InputStream.php → src/IO/InputStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions src/io/JsonRpcInput.php → src/IO/JsonRpcInput.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DawidMazurek\JsonRpc\io;
namespace DawidMazurek\JsonRpc\IO;

use DawidMazurek\JsonRpc\request\JsonRpcRequestAggregate;
use DawidMazurek\JsonRpc\Request\JsonRpcRequestAggregate;

interface JsonRpcInput
{
Expand Down
4 changes: 2 additions & 2 deletions src/io/JsonSerializer.php → src/IO/JsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\io;
namespace DawidMazurek\JsonRpc\IO;

use DawidMazurek\JsonRpc\exception\ParseError;
use DawidMazurek\JsonRpc\Exception\ParseError;

class JsonSerializer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

interface IdentifiedJsonRpcRequest extends JsonRpcRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

interface JsonRpcRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

class JsonRpcRequestAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

use DawidMazurek\JsonRpc\exception\InvalidParams;
use DawidMazurek\JsonRpc\io\JsonSerializer;
use DawidMazurek\JsonRpc\Exception\InvalidParams;
use DawidMazurek\JsonRpc\IO\JsonSerializer;

class JsonRpcRequestBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

class Notification implements JsonRpcRequest
{
Expand Down
2 changes: 1 addition & 1 deletion src/request/Request.php → src/Request/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\request;
namespace DawidMazurek\JsonRpc\Request;

class Request implements IdentifiedJsonRpcRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\response;
namespace DawidMazurek\JsonRpc\Response;

class FailedResponse implements JsonRpcResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\response;
namespace DawidMazurek\JsonRpc\Response;

interface JsonRpcResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\response;
namespace DawidMazurek\JsonRpc\Response;

class JsonRpcResponseAggregate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\response;
namespace DawidMazurek\JsonRpc\Response;

class NotificationResponse implements JsonRpcResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/response/Response.php → src/Response/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\response;
namespace DawidMazurek\JsonRpc\Response;

class Response implements JsonRpcResponse
{
Expand Down
10 changes: 5 additions & 5 deletions src/server/JsonRpcServer.php → src/Server/JsonRpcServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types = 1);

namespace DawidMazurek\JsonRpc\server;
namespace DawidMazurek\JsonRpc\Server;

use DawidMazurek\JsonRpc\exception\JsonRpcException;
use DawidMazurek\JsonRpc\handler\JsonRpcRequestHandler;
use DawidMazurek\JsonRpc\io\JsonRpcInput;
use DawidMazurek\JsonRpc\response\JsonRpcResponseAggregate;
use DawidMazurek\JsonRpc\Exception\JsonRpcException;
use DawidMazurek\JsonRpc\Handler\JsonRpcRequestHandler;
use DawidMazurek\JsonRpc\IO\JsonRpcInput;
use DawidMazurek\JsonRpc\Response\JsonRpcResponseAggregate;

class JsonRpcServer
{
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/JsonRpcServerIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types = 1);

use DawidMazurek\JsonRpc\handler\MethodCallableHandler;
use DawidMazurek\JsonRpc\io\CustomStringInput;
use DawidMazurek\JsonRpc\io\JsonSerializer;
use DawidMazurek\JsonRpc\request\JsonRpcRequestBuilder;
use DawidMazurek\JsonRpc\response\JsonRpcResponseAggregate;
use DawidMazurek\JsonRpc\server\JsonRpcServer;
use DawidMazurek\JsonRpc\Handler\MethodCallableHandler;
use DawidMazurek\JsonRpc\IO\CustomStringInput;
use DawidMazurek\JsonRpc\IO\JsonSerializer;
use DawidMazurek\JsonRpc\Request\JsonRpcRequestBuilder;
use DawidMazurek\JsonRpc\Response\JsonRpcResponseAggregate;
use DawidMazurek\JsonRpc\Server\JsonRpcServer;
use PHPUnit\Framework\TestCase;

class JsonRpcServerIntegrationTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
use PHPUnit\Framework\TestCase;

class InvalidParamsTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
use PHPUnit\Framework\TestCase;

class InvalidRequestTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
use PHPUnit\Framework\TestCase;

class MethodNotFoundTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
use PHPUnit\Framework\TestCase;

class ParseErrorTest extends TestCase
Expand Down
Loading

0 comments on commit ec45f51

Please sign in to comment.