Skip to content

Commit 138a9a7

Browse files
SlimGeegithub-actions[bot]
authored andcommitted
Fix styling
1 parent f879f7d commit 138a9a7

File tree

5 files changed

+12
-30
lines changed

5 files changed

+12
-30
lines changed

config/bytepoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
// config for FlixtechsLabs/Bytepoint
44
return [
55
'token' => env('BYTEPOINT_TOKEN', 'Mg.XeviY1dxjW7zrgUGoIKf4aWkCJ7gsnh5mY-7U10hOMAp363A_mAnumdkyJnP'),
6-
'url' => env('BYTEPOINT_URL', 'https://bytepoint.flixtechs.co.zw/api/v1/images')
6+
'url' => env('BYTEPOINT_URL', 'https://bytepoint.flixtechs.co.zw/api/v1/images'),
77
];

src/Bytepoint.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,18 @@ class Bytepoint
99
{
1010
/**
1111
* Send image to bytepoint and retrieve optimized image
12-
*
13-
* @param string $source
14-
* @param string $destination
15-
* @param string $fileName
16-
* @param array $options
17-
* @return void
1812
*/
1913
public function optimize(string $source, string $destination, string $fileName = '', array $options = []): void
2014
{
2115
$options = array_merge([
22-
'type' => 'jpeg'
16+
'type' => 'jpeg',
2317
], $options);
2418

2519
$response = Http::attach('image', file_get_contents($source), $fileName ?: 'image')
2620
->withToken(config('bytepoint.token'))
2721
->acceptJson()
2822
->post(config('bytepoint.url'), [
29-
'type' => $options['type']
23+
'type' => $options['type'],
3024
]);
3125

3226
if ($response->successful()) {
@@ -39,10 +33,6 @@ public function optimize(string $source, string $destination, string $fileName =
3933

4034
/**
4135
* Optimize uploaded file
42-
*
43-
* @param UploadedFile $file
44-
* @param array $options
45-
* @return void
4636
*/
4737
public function optimizeUploadedFile(UploadedFile $file, array $options = []): void
4838
{

src/BytepointServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace FlixtechsLabs\Bytepoint;
44

5-
use Spatie\LaravelPackageTools\Package;
6-
use Spatie\LaravelPackageTools\PackageServiceProvider;
75
use FlixtechsLabs\Bytepoint\Commands\BytepointCommand;
86
use Illuminate\Http\UploadedFile;
7+
use Spatie\LaravelPackageTools\Package;
8+
use Spatie\LaravelPackageTools\PackageServiceProvider;
99

1010
class BytepointServiceProvider extends PackageServiceProvider
1111
{
@@ -29,7 +29,7 @@ public function boot(): void
2929
parent::boot();
3030

3131
UploadedFile::macro('bytepoint', function (array $options = []) {
32-
app(Bytepoint::class)->optimizeUploadedFile($this, $options);
32+
app(Bytepoint::class)->optimizeUploadedFile($this, $options);
3333

3434
return new UploadedFile(
3535
$this->getRealPath(),

tests/ExampleTest.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
<?php
22

3-
use FlixtechsLabs\Bytepoint\Bytepoint;
4-
use Illuminate\Http\Request;
53
use Illuminate\Http\UploadedFile;
6-
use Illuminate\Support\Benchmark;
7-
use Illuminate\Support\Facades\Artisan;
8-
use Illuminate\Support\Facades\Http;
9-
use Illuminate\Support\Facades\Route;
10-
use Illuminate\Support\Facades\Storage;
11-
124

135
it('can test', function () {
146
expect(true)->toBeTrue();
157
});
168

179
it('can optimize uploaded file', function () {
18-
$file = new UploadedFile(__DIR__ . '/test.jpg', 'test.jpg', null, null, true);
10+
$file = new UploadedFile(__DIR__.'/test.jpg', 'test.jpg', null, null, true);
1911

20-
$size = $file->getSize();
21-
$type = $file->getMimeType();
12+
$size = $file->getSize();
13+
$type = $file->getMimeType();
2214

23-
$file = $file->bytepoint(['type' => 'webp']);
15+
$file = $file->bytepoint(['type' => 'webp']);
2416

25-
dd($size, $type, $file->getSize(), $file->getMimeType());
17+
dd($size, $type, $file->getSize(), $file->getMimeType());
2618
});

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace FlixtechsLabs\Bytepoint\Tests;
44

5+
use FlixtechsLabs\Bytepoint\BytepointServiceProvider;
56
use Illuminate\Database\Eloquent\Factories\Factory;
67
use Orchestra\Testbench\TestCase as Orchestra;
7-
use FlixtechsLabs\Bytepoint\BytepointServiceProvider;
88

99
class TestCase extends Orchestra
1010
{

0 commit comments

Comments
 (0)