also looking at this
Apply fixes from StyleCI
#2
6 files
+31
-33
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -2,13 +2,13 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Cion\LaravelCloudflare; |
| 4 | 4 | |
| 5 | use GuzzleHttp\Promise; | |
| 6 | use Psr\Log\LoggerInterface; | |
| 7 | use Illuminate\Support\Collection; | |
| 8 | 5 | use GuzzleHttp\Client as GuzzleClient; |
| 9 | use Psr\Http\Message\ResponseInterface; | |
| 10 | 6 | use GuzzleHttp\Exception\ClientException; |
| 11 | 7 | use GuzzleHttp\Exception\RequestException; |
| 8 | use GuzzleHttp\Promise; | |
| 9 | use Illuminate\Support\Collection; | |
| 10 | use Psr\Http\Message\ResponseInterface; | |
| 11 | use Psr\Log\LoggerInterface; | |
| 12 | 12 | |
| 13 | 13 | class Client |
| 14 | 14 | { |
| @@ -30,8 +30,8 @@ class Client formatting only | ||
| 30 | 30 | /** |
| 31 | 31 | * Constructor. |
| 32 | 32 | * |
| 33 | * @param \GuzzleHttp\Client $client | |
| 34 | * @param \Psr\Log\LoggerInterface $logger | |
| 33 | * @param \GuzzleHttp\Client $client | |
| 34 | * @param \Psr\Log\LoggerInterface $logger | |
| 35 | 35 | */ |
| 36 | 36 | public function __construct(GuzzleClient $client, LoggerInterface $logger) |
| 37 | 37 | { |
| @@ -67,7 +67,7 @@ class Client formatting only | ||
| 67 | 67 | * |
| 68 | 68 | * The returned promise is fulfilled with a collection of results. |
| 69 | 69 | * |
| 70 | * @param \Illuminate\Support\Collection|\GuzzleHttp\Promise\PromiseInterface[] $promises | |
| 70 | * @param \Illuminate\Support\Collection|\GuzzleHttp\Promise\PromiseInterface[] $promises | |
| 71 | 71 | * @return \GuzzleHttp\Promise\PromiseInterface |
| 72 | 72 | */ |
| 73 | 73 | protected function settle(Collection $promises) |
| @@ -86,7 +86,7 @@ class Client formatting only | ||
| 86 | 86 | /** |
| 87 | 87 | * Put the body of the fulfilled promise into the results. |
| 88 | 88 | * |
| 89 | * @param \Illuminate\Support\Collection|object[] $results | |
| 89 | * @param \Illuminate\Support\Collection|object[] $results | |
| 90 | 90 | * @return \Closure |
| 91 | 91 | */ |
| 92 | 92 | protected function onFulfilled(Collection $results) |
| @@ -99,7 +99,7 @@ class Client formatting only | ||
| 99 | 99 | /** |
| 100 | 100 | * Handle the rejected promise and put the errors into the results. |
| 101 | 101 | * |
| 102 | * @param \Illuminate\Support\Collection|object[] $results | |
| 102 | * @param \Illuminate\Support\Collection|object[] $results | |
| 103 | 103 | * @return \Closure |
| 104 | 104 | */ |
| 105 | 105 | protected function onRejected(Collection $results) |
| @@ -117,7 +117,7 @@ class Client formatting only | ||
| 117 | 117 | /** |
| 118 | 118 | * Transform a request exception into a result object. |
| 119 | 119 | * |
| 120 | * @param \GuzzleHttp\Exception\RequestException $e | |
| 120 | * @param \GuzzleHttp\Exception\RequestException $e | |
| 121 | 121 | * @return \stdClass |
| 122 | 122 | */ |
| 123 | 123 | protected function handleException(RequestException $e) |
| @@ -151,7 +151,7 @@ class Client formatting only | ||
| 151 | 151 | /** |
| 152 | 152 | * Transform the response body into a result object. |
| 153 | 153 | * |
| 154 | * @param \Psr\Http\Message\ResponseInterface $response | |
| 154 | * @param \Psr\Http\Message\ResponseInterface $response | |
| 155 | 155 | * @return \stdClass |
| 156 | 156 | */ |
| 157 | 157 | protected function getBody(ResponseInterface $response) |
| @@ -2,12 +2,12 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Cion\LaravelCloudflare\Commands\Cache; |
| 4 | 4 | |
| 5 | use Illuminate\Console\Command; | |
| 6 | 5 | use Cion\LaravelCloudflare\Client; |
| 6 | use Illuminate\Console\Command; | |
| 7 | 7 | use Illuminate\Support\Collection; |
| 8 | 8 | use Symfony\Component\Console\Helper\TableCell; |
| 9 | use Symfony\Component\HttpFoundation\ParameterBag; | |
| 10 | 9 | use Symfony\Component\Console\Helper\TableSeparator; |
| 10 | use Symfony\Component\HttpFoundation\ParameterBag; | |
| 11 | 11 | |
| 12 | 12 | class Purge extends Command |
| 13 | 13 | { |
| @@ -52,8 +52,8 @@ class Purge extends Command | ||
| 52 | 52 | /** |
| 53 | 53 | * Purge constructor. |
| 54 | 54 | * |
| 55 | * @param \Cion\LaravelCloudflare\Client $client | |
| 56 | * @param array $zones | |
| 55 | * @param \Cion\LaravelCloudflare\Client $client | |
| 56 | * @param array $zones | |
| 57 | 57 | */ |
| 58 | 58 | public function __construct(Client $client, array $zones) |
| 59 | 59 | { |
| @@ -95,7 +95,7 @@ class Purge extends Command | ||
| 95 | 95 | * |
| 96 | 96 | * Use the config for each zone, unless options are passed in the command. |
| 97 | 97 | * |
| 98 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 98 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 99 | 99 | * @return \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] |
| 100 | 100 | */ |
| 101 | 101 | private function applyParameters(Collection $zones) |
| @@ -118,7 +118,7 @@ class Purge extends Command | ||
| 118 | 118 | /** |
| 119 | 119 | * Execute the purging operations and return each result. |
| 120 | 120 | * |
| 121 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 121 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 122 | 122 | * @return \Illuminate\Support\Collection|\stdClass[] |
| 123 | 123 | */ |
| 124 | 124 | private function purge(Collection $zones) |
| @@ -139,8 +139,8 @@ class Purge extends Command | ||
| 139 | 139 | /** |
| 140 | 140 | * Display a table with the results. |
| 141 | 141 | * |
| 142 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 143 | * @param \Illuminate\Support\Collection|\stdClass[] $results | |
| 142 | * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones | |
| 143 | * @param \Illuminate\Support\Collection|\stdClass[] $results | |
| 144 | 144 | * @return void |
| 145 | 145 | */ |
| 146 | 146 | private function displayResults(Collection $zones, Collection $results) |
| @@ -198,7 +198,7 @@ class Purge extends Command | ||
| 198 | 198 | /** |
| 199 | 199 | * Format an array into a multiline string. |
| 200 | 200 | * |
| 201 | * @param array|null $items | |
| 201 | * @param array|null $items | |
| 202 | 202 | * @return string |
| 203 | 203 | */ |
| 204 | 204 | private function formatItems(array $items = null) |
| @@ -209,7 +209,7 @@ class Purge extends Command | ||
| 209 | 209 | /** |
| 210 | 210 | * Format the errors. |
| 211 | 211 | * |
| 212 | * @param \stdClass[] $errors | |
| 212 | * @param \stdClass[] $errors | |
| 213 | 213 | * @return string[] |
| 214 | 214 | */ |
| 215 | 215 | private function formatErrors(array $errors) |
| @@ -248,7 +248,7 @@ class Purge extends Command | ||
| 248 | 248 | /** |
| 249 | 249 | * Return 1 if all successes are false, otherwise return 0. |
| 250 | 250 | * |
| 251 | * @param \Illuminate\Support\Collection $results | |
| 251 | * @param \Illuminate\Support\Collection $results | |
| 252 | 252 | * @return int |
| 253 | 253 | */ |
| 254 | 254 | private function getExitCode(Collection $results) |
| @@ -2,8 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Cion\LaravelCloudflare; |
| 4 | 4 | |
| 5 | use Illuminate\Support\Collection; | |
| 6 | 5 | use GuzzleHttp\Client as GuzzleClient; |
| 6 | use Illuminate\Support\Collection; | |
| 7 | 7 | use Illuminate\Support\ServiceProvider as BaseServiceProvider; |
| 8 | 8 | |
| 9 | 9 | class ServiceProvider extends BaseServiceProvider |
| @@ -2,14 +2,14 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Cion\LaravelCloudflare\Test; |
| 4 | 4 | |
| 5 | use GuzzleHttp\Middleware; | |
| 6 | use GuzzleHttp\HandlerStack; | |
| 7 | use GuzzleHttp\Psr7\Request; | |
| 8 | use GuzzleHttp\Psr7\Response; | |
| 9 | 5 | use Cion\LaravelCloudflare\Client; |
| 10 | use GuzzleHttp\Handler\MockHandler; | |
| 11 | 6 | use GuzzleHttp\Client as GuzzleClient; |
| 12 | 7 | use GuzzleHttp\Exception\RequestException; |
| 8 | use GuzzleHttp\Handler\MockHandler; | |
| 9 | use GuzzleHttp\HandlerStack; | |
| 10 | use GuzzleHttp\Middleware; | |
| 11 | use GuzzleHttp\Psr7\Request; | |
| 12 | use GuzzleHttp\Psr7\Response; | |
| 13 | 13 | |
| 14 | 14 | trait GuzzleHelpers |
| 15 | 15 | { |
| @@ -29,7 +29,7 @@ trait GuzzleHelpers formatting only | ||
| 29 | 29 | * Assert the request URI contains the given path. |
| 30 | 30 | * |
| 31 | 31 | * @param array $transaction |
| 32 | * @param string $path | |
| 32 | * @param string $path | |
| 33 | 33 | * @return self |
| 34 | 34 | */ |
| 35 | 35 | protected function seeRequestContainsPath(array $transaction, $path) |
| @@ -3,8 +3,8 @@ | ||
| 3 | 3 | namespace Cion\LaravelCloudflare\Test; |
| 4 | 4 | |
| 5 | 5 | use Cion\LaravelCloudflare\Client; |
| 6 | use Cion\LaravelCloudflare\ServiceProvider; | |
| 7 | 6 | use Cion\LaravelCloudflare\Commands\Cache\Purge; |
| 7 | use Cion\LaravelCloudflare\ServiceProvider; | |
| 8 | 8 | |
| 9 | 9 | class ServiceProviderTest extends TestCase |
| 10 | 10 | { |
| @@ -11,7 +11,6 @@ abstract class TestCase extends BaseTestCase | ||
| 11 | 11 | * Get package providers. |
| 12 | 12 | * |
| 13 | 13 | * @param \Illuminate\Foundation\Application $app |
| 14 | * | |
| 15 | 14 | * @return array |
| 16 | 15 | */ |
| 17 | 16 | protected function getPackageProviders($app) |
| @@ -22,8 +21,7 @@ abstract class TestCase extends BaseTestCase | ||
| 22 | 21 | /** |
| 23 | 22 | * Define environment setup. |
| 24 | 23 | * |
| 25 | * @param \Illuminate\Foundation\Application $app | |
| 26 | * | |
| 24 | * @param \Illuminate\Foundation\Application $app | |
| 27 | 25 | * @return void |
| 28 | 26 | */ |
| 29 | 27 | protected function getEnvironmentSetUp($app) |