@@ -56,7 +56,7 @@ |
||
56 | 56 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'blockchain'); |
57 | 57 | |
58 | 58 | // Register the main class to use with the facade |
59 | - $this->app->singleton('blockchain', function () { |
|
59 | + $this->app->singleton('blockchain', function() { |
|
60 | 60 | $config = app('config')->get('blockchain'); |
61 | 61 | return (new Blockchain($config)); |
62 | 62 | }); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use GuzzleHttp\Exception\GuzzleException; |
10 | 10 | use Illuminate\Contracts\Container\Container; |
11 | 11 | |
12 | -class Blockchain{ |
|
12 | +class Blockchain { |
|
13 | 13 | |
14 | 14 | protected $client; |
15 | 15 | protected $params; |
@@ -17,29 +17,29 @@ discard block |
||
17 | 17 | const GET = 'GET'; |
18 | 18 | const POST = 'POST'; |
19 | 19 | |
20 | - public function __construct($config){ |
|
21 | - $this->client = new Client(['base_uri'=>data_get($config,'base_uri')]); |
|
22 | - $this->params['api_code'] = data_get($config,'api_code'); |
|
20 | + public function __construct($config) { |
|
21 | + $this->client = new Client(['base_uri'=>data_get($config, 'base_uri')]); |
|
22 | + $this->params['api_code'] = data_get($config, 'api_code'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @return Create |
27 | 27 | */ |
28 | - public function Create(){ |
|
28 | + public function Create() { |
|
29 | 29 | return new Create($this); |
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @return Wallet |
34 | 34 | */ |
35 | - public function Wallet(){ |
|
35 | + public function Wallet() { |
|
36 | 36 | return new Wallet($this); |
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @return Receive |
41 | 41 | */ |
42 | - public function Receive(){ |
|
42 | + public function Receive() { |
|
43 | 43 | return new Receive(); |
44 | 44 | } |
45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param $base_uri string Default : http://localhost:3000 |
48 | 48 | */ |
49 | 49 | |
50 | - public function newBaseUri($base_uri){ |
|
50 | + public function newBaseUri($base_uri) { |
|
51 | 51 | $this->client = new Client(['base_uri'=>$base_uri]); |
52 | 52 | } |
53 | 53 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return array |
59 | 59 | */ |
60 | 60 | |
61 | - public function Request($method, $url, $params){ |
|
61 | + public function Request($method, $url, $params) { |
|
62 | 62 | $params = array_merge($params, $this->params); |
63 | 63 | $options = array( |
64 | 64 | 'form_params'=>$params, |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ); |
69 | 69 | try { |
70 | 70 | $response = $this->client->request($method, $url, $options); |
71 | - return json_decode($response->getBody()->getContents(),true); |
|
71 | + return json_decode($response->getBody()->getContents(), true); |
|
72 | 72 | } catch (GuzzleException $e) { |
73 | 73 | echo $e->getMessage(); |
74 | 74 | } |