From 5ae0274956b0d15559d038608c4257d2a9312605 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Mon, 9 Apr 2018 10:15:27 +0800 Subject: [PATCH] Update CS. Signed-off-by: Mior Muhammad Zaki --- .php_cs | 7 +++++-- src/Client.php | 18 +++++++++--------- src/One/Message.php | 12 ++++++------ tests/ClientTest.php | 4 ++-- tests/One/MessageTest.php | 4 ++-- tests/ResponseTest.php | 2 +- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.php_cs b/.php_cs index 9c153f3..ffcbf7e 100644 --- a/.php_cs +++ b/.php_cs @@ -8,12 +8,15 @@ return PhpCsFixer\Config::create() ->setRiskyAllowed(false) ->setRules([ '@Symfony' => true, + 'array_syntax' => ['syntax' => 'short'], 'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false], + 'increment_style' => ['style' => 'post'], 'no_empty_comment' => false, 'no_extra_consecutive_blank_lines' => false, + 'no_unneeded_control_parentheses' => false, 'not_operator_with_successor_space' => true, - 'ordered_imports' => ['sortAlgorithm' => 'length'], - 'phpdoc_align' => false, + 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'phpdoc_align' => ['tags' => ['param']], 'phpdoc_no_empty_return' => false, 'phpdoc_order' => true, 'pre_increment' => false, diff --git a/src/Client.php b/src/Client.php index ef85bfc..b416f98 100644 --- a/src/Client.php +++ b/src/Client.php @@ -2,11 +2,11 @@ namespace Silverstreet; -use Laravie\Codex\Discovery; -use Laravie\Codex\Client as BaseClient; -use Psr\Http\Message\ResponseInterface; use Http\Client\Common\HttpMethodsClient as HttpClient; +use Laravie\Codex\Client as BaseClient; use Laravie\Codex\Contracts\Response as ResponseContract; +use Laravie\Codex\Discovery; +use Psr\Http\Message\ResponseInterface; class Client extends BaseClient { @@ -43,9 +43,9 @@ class Client extends BaseClient /** * Construct a new Billplz Client. * - * @param \Http\Client\Common\HttpMethodsClient $http - * @param string $apiUsername - * @param string $apiPassword + * @param \Http\Client\Common\HttpMethodsClient $http + * @param string $apiUsername + * @param string $apiPassword */ public function __construct(HttpClient $http, string $apiUsername, string $apiPassword) { @@ -57,8 +57,8 @@ public function __construct(HttpClient $http, string $apiUsername, string $apiPa /** * Make a client. * - * @param string $apiUsername - * @param string $apiPassword + * @param string $apiUsername + * @param string $apiPassword * * @return static */ @@ -90,7 +90,7 @@ final public function getApiPassword(): string /** * Resolve the responder class. * - * @param \Psr\Http\Message\ResponseInterface $response + * @param \Psr\Http\Message\ResponseInterface $response * * @return \Laravie\Codex\Contracts\Response */ diff --git a/src/One/Message.php b/src/One/Message.php index 19404b4..1066418 100644 --- a/src/One/Message.php +++ b/src/One/Message.php @@ -2,9 +2,9 @@ namespace Silverstreet\One; -use Silverstreet\Request; -use Laravie\Codex\Contracts\Response; use Laravie\Codex\Concerns\Request\Multipart; +use Laravie\Codex\Contracts\Response; +use Silverstreet\Request; class Message extends Request { @@ -13,10 +13,10 @@ class Message extends Request /** * Send SMS. * - * @param string $body - * @param string $destination - * @param string $sender - * @param array $optional + * @param string $body + * @param string $destination + * @param string $sender + * @param array $optional * * @return \Laravie\Codex\Contracts\Response */ diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 089acf5..7c394d2 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -2,10 +2,10 @@ namespace Silverstreet\TestCase; +use Laravie\Codex\Client as Codex; use Mockery as m; -use Silverstreet\Client; use PHPUnit\Framework\TestCase; -use Laravie\Codex\Client as Codex; +use Silverstreet\Client; class ClientTest extends TestCase { diff --git a/tests/One/MessageTest.php b/tests/One/MessageTest.php index b4ed09c..33b3a20 100644 --- a/tests/One/MessageTest.php +++ b/tests/One/MessageTest.php @@ -2,10 +2,10 @@ namespace Silverstreet\TestCase\One; +use Laravie\Codex\Testing\Faker; use Mockery as m; -use Silverstreet\Client; use PHPUnit\Framework\TestCase; -use Laravie\Codex\Testing\Faker; +use Silverstreet\Client; class MessageTest extends TestCase { diff --git a/tests/ResponseTest.php b/tests/ResponseTest.php index 6ca0387..7ca1d3e 100644 --- a/tests/ResponseTest.php +++ b/tests/ResponseTest.php @@ -3,9 +3,9 @@ namespace Silverstreet\TestCase; use Mockery as m; -use Silverstreet\Response; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; +use Silverstreet\Response; class ResponseTest extends TestCase {