@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function __invoke(Request $request) |
| 19 | 19 | { |
| 20 | 20 | $eventPayload = $this->getJsonPayloadFromRequest($request); |
| 21 | - if (! isset($eventPayload['type'])) { |
|
| 21 | + if (!isset($eventPayload['type'])) { |
|
| 22 | 22 | throw WebhookFailed::missingType($request); |
| 23 | 23 | } |
| 24 | 24 | $type = $eventPayload['type']; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | if ('' === $jobClass) { |
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | - if (! class_exists($jobClass)) { |
|
| 31 | + if (!class_exists($jobClass)) { |
|
| 32 | 32 | throw WebhookFailed::jobClassDoesNotExist($jobClass, $WebhookCall); |
| 33 | 33 | } |
| 34 | 34 | dispatch(new $jobClass($WebhookCall)); |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $signature = $request->header('X-Multicoin-Signature'); |
| 13 | 13 | |
| 14 | - if (! $signature) { |
|
| 14 | + if (!$signature) { |
|
| 15 | 15 | throw WebhookFailed::missingSignature(); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - if (! $this->isValid($signature, $request)) { |
|
| 18 | + if (!$this->isValid($signature, $request)) { |
|
| 19 | 19 | throw WebhookFailed::invalidSignature($signature); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | protected function registerClient() |
| 56 | 56 | { |
| 57 | - $this->app->bind('multicoin.currency', function ($app) { |
|
| 57 | + $this->app->bind('multicoin.currency', function($app) { |
|
| 58 | 58 | return $app['multicoin']->currency(); |
| 59 | 59 | }); |
| 60 | 60 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function registerFactory() |
| 68 | 68 | { |
| 69 | - $this->app->singleton('multicoin', function ($app) { |
|
| 69 | + $this->app->singleton('multicoin', function($app) { |
|
| 70 | 70 | return new MulticoinFactory(config('multicoin')); |
| 71 | 71 | }); |
| 72 | 72 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | private function registerRoutes() |
| 84 | 84 | { |
| 85 | - Route::macro('multicoinWebhook', function ($url) { |
|
| 85 | + Route::macro('multicoinWebhook', function($url) { |
|
| 86 | 86 | return Route::any($url, '\Multicoin\Api\Http\Controllers\WebhookController'); |
| 87 | 87 | }); |
| 88 | 88 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function currency(string $name = 'BTC'): Multicoincurrency |
| 54 | 54 | { |
| 55 | - if (! array_key_exists($name, $this->currencys)) { |
|
| 55 | + if (!array_key_exists($name, $this->currencys)) { |
|
| 56 | 56 | $config = $this->getConfig($name); |
| 57 | 57 | |
| 58 | 58 | $this->currencys[$name] = $this->make($config); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $flip_currency = array_flip($this->config['currency']); |
| 73 | 73 | |
| 74 | - if (! array_key_exists($name, $flip_currency)) { |
|
| 74 | + if (!array_key_exists($name, $flip_currency)) { |
|
| 75 | 75 | throw new InvalidArgumentException( |
| 76 | 76 | "Could not find currency configuration [$name]" |
| 77 | 77 | ); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return new PluginClient($this->httpClient, $this->plugins); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function doGet(string $url): ?Collection |
|
| 72 | + public function doGet(string $url): ?Collection |
|
| 73 | 73 | { |
| 74 | 74 | try { |
| 75 | 75 | $request = $this->client->get($url); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return $this->responseResult($response); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - public function doPost(string $url, array $data = []): ?Collection |
|
| 89 | + public function doPost(string $url, array $data = []): ?Collection |
|
| 90 | 90 | { |
| 91 | 91 | try { |
| 92 | 92 | $request = $this->client->post($url, $data); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $this->responseResult($response); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - protected function responseResult(?string $response) :? Collection |
|
| 106 | + protected function responseResult(?string $response) : ? Collection |
|
| 107 | 107 | { |
| 108 | 108 | $data = json_decode($response, true); |
| 109 | 109 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('multicoin')) { |
|
| 3 | +if (!function_exists('multicoin')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * Get bitcoind client instance by name. |
| 6 | 6 | * |
@@ -35,11 +35,11 @@ |
||
| 35 | 35 | |
| 36 | 36 | return $response; |
| 37 | 37 | } |
| 38 | - public function withdraw($address,$amount) |
|
| 38 | + public function withdraw($address, $amount) |
|
| 39 | 39 | { |
| 40 | 40 | |
| 41 | 41 | $url = '/user/'.$this->coin.'/withdraw'; |
| 42 | - $response = $this->client->doPost($url, ['address'=>$address,'amount'=>$amount]); |
|
| 42 | + $response = $this->client->doPost($url, ['address'=>$address, 'amount'=>$amount]); |
|
| 43 | 43 | |
| 44 | 44 | return $response; |
| 45 | 45 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | ]; |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -$api = new Multicoin($config); |
|
| 18 | +$api = new Multicoin($config); |
|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | // $invoice = $api->createInvoice(['user_id' => 1]); |