ReviewOS

also looking at this

ci-on/laravel-cloudflare

Apply fixes from StyleCI

#2
Merged glennmichael123 wants to merge analysis-5443oY into master
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.

src/Client.phpmodified+11-11
Changes to src/Client.php
@@ -2,13 +2,13 @@
22
33namespace Cion\LaravelCloudflare;
44
5use GuzzleHttp\Promise;
6use Psr\Log\LoggerInterface;
7use Illuminate\Support\Collection;
85use GuzzleHttp\Client as GuzzleClient;
9use Psr\Http\Message\ResponseInterface;
106use GuzzleHttp\Exception\ClientException;
117use GuzzleHttp\Exception\RequestException;
8use GuzzleHttp\Promise;
9use Illuminate\Support\Collection;
10use Psr\Http\Message\ResponseInterface;
11use Psr\Log\LoggerInterface;
1212
1313class Client
1414{
@@ -30,8 +30,8 @@ class Client formatting only
3030 /**
3131 * Constructor.
3232 *
33 * @param \GuzzleHttp\Client $client
34 * @param \Psr\Log\LoggerInterface $logger
33 * @param \GuzzleHttp\Client $client
34 * @param \Psr\Log\LoggerInterface $logger
3535 */
3636 public function __construct(GuzzleClient $client, LoggerInterface $logger)
3737 {
@@ -67,7 +67,7 @@ class Client formatting only
6767 *
6868 * The returned promise is fulfilled with a collection of results.
6969 *
70 * @param \Illuminate\Support\Collection|\GuzzleHttp\Promise\PromiseInterface[] $promises
70 * @param \Illuminate\Support\Collection|\GuzzleHttp\Promise\PromiseInterface[] $promises
7171 * @return \GuzzleHttp\Promise\PromiseInterface
7272 */
7373 protected function settle(Collection $promises)
@@ -86,7 +86,7 @@ class Client formatting only
8686 /**
8787 * Put the body of the fulfilled promise into the results.
8888 *
89 * @param \Illuminate\Support\Collection|object[] $results
89 * @param \Illuminate\Support\Collection|object[] $results
9090 * @return \Closure
9191 */
9292 protected function onFulfilled(Collection $results)
@@ -99,7 +99,7 @@ class Client formatting only
9999 /**
100100 * Handle the rejected promise and put the errors into the results.
101101 *
102 * @param \Illuminate\Support\Collection|object[] $results
102 * @param \Illuminate\Support\Collection|object[] $results
103103 * @return \Closure
104104 */
105105 protected function onRejected(Collection $results)
@@ -117,7 +117,7 @@ class Client formatting only
117117 /**
118118 * Transform a request exception into a result object.
119119 *
120 * @param \GuzzleHttp\Exception\RequestException $e
120 * @param \GuzzleHttp\Exception\RequestException $e
121121 * @return \stdClass
122122 */
123123 protected function handleException(RequestException $e)
@@ -151,7 +151,7 @@ class Client formatting only
151151 /**
152152 * Transform the response body into a result object.
153153 *
154 * @param \Psr\Http\Message\ResponseInterface $response
154 * @param \Psr\Http\Message\ResponseInterface $response
155155 * @return \stdClass
156156 */
157157 protected function getBody(ResponseInterface $response)
src/Commands/Cache/Purge.phpmodifiedformatting only+11-11
Changes to src/Commands/Cache/Purge.php
@@ -2,12 +2,12 @@
22
33namespace Cion\LaravelCloudflare\Commands\Cache;
44
5use Illuminate\Console\Command;
65use Cion\LaravelCloudflare\Client;
6use Illuminate\Console\Command;
77use Illuminate\Support\Collection;
88use Symfony\Component\Console\Helper\TableCell;
9use Symfony\Component\HttpFoundation\ParameterBag;
109use Symfony\Component\Console\Helper\TableSeparator;
10use Symfony\Component\HttpFoundation\ParameterBag;
1111
1212class Purge extends Command
1313{
@@ -52,8 +52,8 @@ class Purge extends Command
5252 /**
5353 * Purge constructor.
5454 *
55 * @param \Cion\LaravelCloudflare\Client $client
56 * @param array $zones
55 * @param \Cion\LaravelCloudflare\Client $client
56 * @param array $zones
5757 */
5858 public function __construct(Client $client, array $zones)
5959 {
@@ -95,7 +95,7 @@ class Purge extends Command
9595 *
9696 * Use the config for each zone, unless options are passed in the command.
9797 *
98 * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones
98 * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones
9999 * @return \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[]
100100 */
101101 private function applyParameters(Collection $zones)
@@ -118,7 +118,7 @@ class Purge extends Command
118118 /**
119119 * Execute the purging operations and return each result.
120120 *
121 * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones
121 * @param \Illuminate\Support\Collection|\Symfony\Component\HttpFoundation\ParameterBag[] $zones
122122 * @return \Illuminate\Support\Collection|\stdClass[]
123123 */
124124 private function purge(Collection $zones)
@@ -139,8 +139,8 @@ class Purge extends Command
139139 /**
140140 * Display a table with the results.
141141 *
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
144144 * @return void
145145 */
146146 private function displayResults(Collection $zones, Collection $results)
@@ -198,7 +198,7 @@ class Purge extends Command
198198 /**
199199 * Format an array into a multiline string.
200200 *
201 * @param array|null $items
201 * @param array|null $items
202202 * @return string
203203 */
204204 private function formatItems(array $items = null)
@@ -209,7 +209,7 @@ class Purge extends Command
209209 /**
210210 * Format the errors.
211211 *
212 * @param \stdClass[] $errors
212 * @param \stdClass[] $errors
213213 * @return string[]
214214 */
215215 private function formatErrors(array $errors)
@@ -248,7 +248,7 @@ class Purge extends Command
248248 /**
249249 * Return 1 if all successes are false, otherwise return 0.
250250 *
251 * @param \Illuminate\Support\Collection $results
251 * @param \Illuminate\Support\Collection $results
252252 * @return int
253253 */
254254 private function getExitCode(Collection $results)
src/ServiceProvider.phpmodifiedformatting only+1-1
Changes to src/ServiceProvider.php
@@ -2,8 +2,8 @@
22
33namespace Cion\LaravelCloudflare;
44
5use Illuminate\Support\Collection;
65use GuzzleHttp\Client as GuzzleClient;
6use Illuminate\Support\Collection;
77use Illuminate\Support\ServiceProvider as BaseServiceProvider;
88
99class ServiceProvider extends BaseServiceProvider
tests/GuzzleHelpers.phpmodified+6-6
Changes to tests/GuzzleHelpers.php
@@ -2,14 +2,14 @@
22
33namespace Cion\LaravelCloudflare\Test;
44
5use GuzzleHttp\Middleware;
6use GuzzleHttp\HandlerStack;
7use GuzzleHttp\Psr7\Request;
8use GuzzleHttp\Psr7\Response;
95use Cion\LaravelCloudflare\Client;
10use GuzzleHttp\Handler\MockHandler;
116use GuzzleHttp\Client as GuzzleClient;
127use GuzzleHttp\Exception\RequestException;
8use GuzzleHttp\Handler\MockHandler;
9use GuzzleHttp\HandlerStack;
10use GuzzleHttp\Middleware;
11use GuzzleHttp\Psr7\Request;
12use GuzzleHttp\Psr7\Response;
1313
1414trait GuzzleHelpers
1515{
@@ -29,7 +29,7 @@ trait GuzzleHelpers formatting only
2929 * Assert the request URI contains the given path.
3030 *
3131 * @param array $transaction
32 * @param string $path
32 * @param string $path
3333 * @return self
3434 */
3535 protected function seeRequestContainsPath(array $transaction, $path)
tests/ServiceProviderTest.phpmodifiedformatting only+1-1
Changes to tests/ServiceProviderTest.php
@@ -3,8 +3,8 @@
33namespace Cion\LaravelCloudflare\Test;
44
55use Cion\LaravelCloudflare\Client;
6use Cion\LaravelCloudflare\ServiceProvider;
76use Cion\LaravelCloudflare\Commands\Cache\Purge;
7use Cion\LaravelCloudflare\ServiceProvider;
88
99class ServiceProviderTest extends TestCase
1010{
tests/TestCase.phpmodified+1-3
Changes to tests/TestCase.php
@@ -11,7 +11,6 @@ abstract class TestCase extends BaseTestCase
1111 * Get package providers.
1212 *
1313 * @param \Illuminate\Foundation\Application $app
14 *
1514 * @return array
1615 */
1716 protected function getPackageProviders($app)
@@ -22,8 +21,7 @@ abstract class TestCase extends BaseTestCase
2221 /**
2322 * Define environment setup.
2423 *
25 * @param \Illuminate\Foundation\Application $app
26 *
24 * @param \Illuminate\Foundation\Application $app
2725 * @return void
2826 */
2927 protected function getEnvironmentSetUp($app)