@@ -25,8 +25,8 @@ |
||
25 | 25 | /** |
26 | 26 | * Make a new BlockingConsumer instance. |
27 | 27 | * |
28 | - * @param \Projectmentor\Quota\Stubs\PayloadInterface $data |
|
29 | - * @return \Projectmentor\Quota\BlockingConsumer |
|
28 | + * @param PayloadInterface $data |
|
29 | + * @return BlockingConsumer |
|
30 | 30 | */ |
31 | 31 | public function make(PayloadInterface $data) |
32 | 32 | { |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * Make a new FileStorage instance. |
28 | 28 | * |
29 | 29 | * @param \Projectmentor\Quota\Stubs\PayloadInterface $data; |
30 | - * @return \Projectmentor\Quota\Storage\FileStorage |
|
30 | + * @return FileStorage |
|
31 | 31 | */ |
32 | 32 | public function make(PayloadInterface $data) |
33 | 33 | { |
@@ -12,7 +12,6 @@ |
||
12 | 12 | namespace Projectmentor\Quota\Factories; |
13 | 13 | |
14 | 14 | use bandwidthThrottle\tokenBucket\storage\FileStorage; |
15 | - |
|
16 | 15 | use Projectmentor\Quota\Contracts\FactoryInterface; |
17 | 16 | use Projectmentor\Quota\Contracts\PayloadInterface; |
18 | 17 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | /** |
26 | 26 | * Make a new TokenBucket instance. |
27 | 27 | * |
28 | - * @param \Projectmentor\Quota\TokenBucketData $data |
|
28 | + * @param PayloadInterface $data |
|
29 | 29 | * @return \bandwidthThrottle\tokenBucket\TokenBucket |
30 | 30 | */ |
31 | 31 | public function make(PayloadInterface $data) |
@@ -11,21 +11,13 @@ |
||
11 | 11 | |
12 | 12 | namespace Projectmentor\Quota; |
13 | 13 | |
14 | -use bandwidthThrottle\tokenBucket\Rate; |
|
15 | -use bandwidthThrottle\tokenBucket\TokenBucket; |
|
16 | -use bandwidthThrottle\tokenBucket\BlockingConsumer; |
|
17 | -use bandwidthThrottle\tokenBucket\storage\FileStorage; |
|
18 | - |
|
19 | 14 | use Illuminate\Foundation\Application as LaravelApplication; |
20 | 15 | use Laravel\Lumen\Application as LumenApplication; |
21 | - |
|
22 | 16 | use Illuminate\Support\ServiceProvider; |
23 | - |
|
24 | 17 | use Projectmentor\Quota\Factories\RateFactory; |
25 | 18 | use Projectmentor\Quota\Factories\FileStorageFactory; |
26 | 19 | use Projectmentor\Quota\Factories\TokenBucketFactory; |
27 | 20 | use Projectmentor\Quota\Factories\BlockingConsumerFactory; |
28 | - |
|
29 | 21 | use Projectmentor\Quota\Stubs\RateData; |
30 | 22 | use Projectmentor\Quota\Stubs\FileStorageData; |
31 | 23 | use Projectmentor\Quota\Stubs\TokenBucketData; |
@@ -108,20 +108,20 @@ |
||
108 | 108 | public function bindInterfaces() |
109 | 109 | { |
110 | 110 | $this->app->when(RateFactory::class) |
111 | - ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
112 | - ->give(RateData::class); |
|
111 | + ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
112 | + ->give(RateData::class); |
|
113 | 113 | |
114 | 114 | $this->app->when(FileStorageFactory::class) |
115 | - ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
116 | - ->give(FileStorageData::class); |
|
115 | + ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
116 | + ->give(FileStorageData::class); |
|
117 | 117 | |
118 | 118 | $this->app->when(TokenBucketFactory::class) |
119 | - ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
120 | - ->give(TokenBucketData::class); |
|
119 | + ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
120 | + ->give(TokenBucketData::class); |
|
121 | 121 | |
122 | 122 | $this->app->when(BlockingConsumerFactory::class) |
123 | - ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
124 | - ->give(BlockingConsumerData::class); |
|
123 | + ->needs('Projectmentor\Quota\Contracts\PayloadInterface') |
|
124 | + ->give(BlockingConsumerData::class); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -130,19 +130,19 @@ |
||
130 | 130 | */ |
131 | 131 | protected function registerFactories() |
132 | 132 | { |
133 | - $this->app->singleton('quota.factory.rate', function ($app) { |
|
133 | + $this->app->singleton('quota.factory.rate', function($app) { |
|
134 | 134 | return new RateFactory; |
135 | 135 | }); |
136 | 136 | |
137 | - $this->app->singleton('quota.factory.storage.file', function ($app) { |
|
137 | + $this->app->singleton('quota.factory.storage.file', function($app) { |
|
138 | 138 | return new FileStorageFactory; |
139 | 139 | }); |
140 | 140 | |
141 | - $this->app->singleton('quota.factory.tokenbucket', function ($app) { |
|
141 | + $this->app->singleton('quota.factory.tokenbucket', function($app) { |
|
142 | 142 | return new TokenBucketFactory; |
143 | 143 | }); |
144 | 144 | |
145 | - $this->app->singleton('quota.factory.blockingconsumer', function ($app) { |
|
145 | + $this->app->singleton('quota.factory.blockingconsumer', function($app) { |
|
146 | 146 | return new BlockingConsumerFactory; |
147 | 147 | }); |
148 | 148 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | /** |
66 | 66 | * Implements PayloadInterface |
67 | 67 | * emit array payload. |
68 | - * @return string |
|
68 | + * @return string[] |
|
69 | 69 | */ |
70 | 70 | public function toArray() |
71 | 71 | { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | /** |
68 | 68 | * Implements PayloadInterface |
69 | 69 | * emit array payload. |
70 | - * @return string |
|
70 | + * @return string[] |
|
71 | 71 | */ |
72 | 72 | public function toArray() |
73 | 73 | { |
@@ -88,7 +88,7 @@ |
||
88 | 88 | /** |
89 | 89 | * Implements PayloadInterface |
90 | 90 | * emit array payload. |
91 | - * @return string |
|
91 | + * @return string[] |
|
92 | 92 | */ |
93 | 93 | public function toArray() |
94 | 94 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | /** |
84 | 84 | * Get the storage instance. |
85 | 85 | * |
86 | - * @return \bandwithThrottle\tokenBucket\storage\FileStorage |
|
86 | + * @return \bandwidthThrottle\tokenBucket\storage\FileStorage |
|
87 | 87 | */ |
88 | 88 | public function getStorage() |
89 | 89 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** |
104 | 104 | * Implements PayloadInterface |
105 | 105 | * emit array payload. |
106 | - * @return string |
|
106 | + * @return string[] |
|
107 | 107 | */ |
108 | 108 | public function toArray() |
109 | 109 | { |
@@ -51,8 +51,8 @@ |
||
51 | 51 | } else { |
52 | 52 | throw new \InvalidArgumentException( |
53 | 53 | __CLASS__.'::'.__FUNCTION__. |
54 | - ' Invalid constant. Got: ' . $key . |
|
55 | - ' Expected: ' . print_r($constants, 1) |
|
54 | + ' Invalid constant. Got: '.$key. |
|
55 | + ' Expected: '.print_r($constants, 1) |
|
56 | 56 | ); |
57 | 57 | } |
58 | 58 | } |