From d7dfa90ff2ee86dee48327b6bf23a4715fc09340 Mon Sep 17 00:00:00 2001 From: Rasmus Nielsen Date: Wed, 1 Nov 2017 13:25:51 +0100 Subject: [PATCH] Apply fixes from StyleCI (#1) --- src/Client.php | 2 +- src/CloudImage.php | 4 ++-- src/CloudImagesServiceProvider.php | 5 +---- src/FailedUploadException.php | 3 +-- tests/Fakes/FakeGuzzleClient.php | 2 +- tests/Fakes/FakeGuzzleResponse.php | 4 ++-- tests/Feature/ImageTest.php | 12 +++++------- tests/Feature/UploadTest.php | 6 +++--- tests/TestCase.php | 2 -- 9 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/Client.php b/src/Client.php index b6e88bc..7f1d35c 100644 --- a/src/Client.php +++ b/src/Client.php @@ -67,4 +67,4 @@ protected function disk() { return Storage::disk($this->diskName); } -} \ No newline at end of file +} diff --git a/src/CloudImage.php b/src/CloudImage.php index d870ec2..c0c82c0 100644 --- a/src/CloudImage.php +++ b/src/CloudImage.php @@ -24,7 +24,7 @@ class CloudImage implements Arrayable */ protected $options = [ 'sizing' => [], - 'custom' => [] + 'custom' => [], ]; /** @@ -149,4 +149,4 @@ public function setGroup($option, $value) return $this; } -} \ No newline at end of file +} diff --git a/src/CloudImagesServiceProvider.php b/src/CloudImagesServiceProvider.php index e4e0fdd..63f1163 100644 --- a/src/CloudImagesServiceProvider.php +++ b/src/CloudImagesServiceProvider.php @@ -11,9 +11,6 @@ class CloudImagesServiceProvider extends ServiceProvider */ protected $defer = true; - /** - * - */ public function register() { $this->app->register(\Superbalist\LaravelGoogleCloudStorage\GoogleCloudStorageServiceProvider::class); @@ -28,7 +25,7 @@ public function register() public function provides() { return [ - Client::class + Client::class, ]; } } diff --git a/src/FailedUploadException.php b/src/FailedUploadException.php index a5b0b34..0c72af6 100644 --- a/src/FailedUploadException.php +++ b/src/FailedUploadException.php @@ -4,5 +4,4 @@ class FailedUploadException extends \Exception { - -} \ No newline at end of file +} diff --git a/tests/Fakes/FakeGuzzleClient.php b/tests/Fakes/FakeGuzzleClient.php index 77333c5..fd7bbc1 100644 --- a/tests/Fakes/FakeGuzzleClient.php +++ b/tests/Fakes/FakeGuzzleClient.php @@ -22,4 +22,4 @@ public function request() { return new FakeGuzzleResponse($this->status); } -} \ No newline at end of file +} diff --git a/tests/Fakes/FakeGuzzleResponse.php b/tests/Fakes/FakeGuzzleResponse.php index 5641b41..74eb712 100644 --- a/tests/Fakes/FakeGuzzleResponse.php +++ b/tests/Fakes/FakeGuzzleResponse.php @@ -24,7 +24,7 @@ public function __construct($status) public function getBody() { return json_encode([ - 'url' => 'http://localhost/somehash' + 'url' => 'http://localhost/somehash', ]); } @@ -35,4 +35,4 @@ public function getStatusCode() { return $this->status; } -} \ No newline at end of file +} diff --git a/tests/Feature/ImageTest.php b/tests/Feature/ImageTest.php index a8a7e49..e7b265c 100644 --- a/tests/Feature/ImageTest.php +++ b/tests/Feature/ImageTest.php @@ -2,39 +2,37 @@ namespace Makeable\CloudImages\Tests\Feature; -use Illuminate\Http\UploadedFile; use Makeable\CloudImages\CloudImage; -use Makeable\CloudImages\FailedUploadException; use Makeable\CloudImages\Tests\TestCase; class ImageTest extends TestCase { /** @test **/ - function it_defaults_to_original() + public function it_defaults_to_original() { $this->assertEquals($this->url('s0'), $this->image()->getUrl()); } /** @test **/ - function it_can_scale_to_max_dimension() + public function it_can_scale_to_max_dimension() { $this->assertEquals($this->url('s400'), $this->image()->maxDimension(400)->getUrl()); } /** @test **/ - function it_can_scale_to_dimensions() + public function it_can_scale_to_dimensions() { $this->assertEquals($this->url('s-w800-h600'), $this->image()->scale(800, 600)->getUrl()); } /** @test **/ - function it_can_crop_to_dimensions() + public function it_can_crop_to_dimensions() { $this->assertEquals($this->url('c-w800-h600'), $this->image()->crop(800, 600)->getUrl()); } /** @test **/ - function it_can_crop_from_center() + public function it_can_crop_from_center() { $this->assertEquals($this->url('n-w800-h600'), $this->image()->cropCenter(800, 600)->getUrl()); } diff --git a/tests/Feature/UploadTest.php b/tests/Feature/UploadTest.php index 2f9fc29..fb8ce82 100644 --- a/tests/Feature/UploadTest.php +++ b/tests/Feature/UploadTest.php @@ -10,7 +10,7 @@ class UploadTest extends TestCase { /** @test **/ - function it_uploads_images() + public function it_uploads_images() { $image = CloudImage::upload(UploadedFile::fake()->image('original-filename.jpg'), 'test.jpg'); @@ -20,7 +20,7 @@ function it_uploads_images() } /** @test **/ - function it_hashes_filename_on_default() + public function it_hashes_filename_on_default() { $image = UploadedFile::fake()->image('original-filename.jpg'); $hash = $image->hashName(); @@ -30,7 +30,7 @@ function it_hashes_filename_on_default() } /** @test **/ - function it_throws_exception_on_failed_upload() + public function it_throws_exception_on_failed_upload() { $this->failHttpRequest(); diff --git a/tests/TestCase.php b/tests/TestCase.php index e3726a4..eef46a5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -38,8 +38,6 @@ public function createApplication() return $app; } - /** - */ public function fakeServices() { Storage::fake('gcs');