Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 6fa69d3

Browse files
authored
Merge pull request #23 from joselfonseca/analysis-XaNnox
Apply fixes from StyleCI
2 parents 7b08f20 + f04ad07 commit 6fa69d3

File tree

6 files changed

+11
-24
lines changed

6 files changed

+11
-24
lines changed

app/Entities/Assets/Asset.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
use Illuminate\Database\Eloquent\Model;
77

88
/**
9-
* Class Asset
10-
*
11-
* @package App\Entities\Assets
9+
* Class Asset.
1210
*/
1311
class Asset extends Model
1412
{

app/Events/AssetWasCreated.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
use App\Entities\Assets\Asset;
66

77
/**
8-
* Class AssetWasCreated
9-
*
10-
* @package App\Events
8+
* Class AssetWasCreated.
119
*/
1210
class AssetWasCreated
1311
{

app/Exceptions/BodyTooLargeException.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
use Exception;
66

77
/**
8-
* Class BodyTooLargeException
9-
*
10-
* @package App\Exceptions
8+
* Class BodyTooLargeException.
119
*/
1210
class BodyTooLargeException extends Exception
1311
{
14-
15-
}
12+
}

app/Http/Controllers/Api/Assets/UploadFileController.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
use Dingo\Api\Exception\StoreResourceFailedException;
1616

1717
/**
18-
* Class UploadFileController
19-
*
20-
* @package App\Http\Controllers\Api\Assets
18+
* Class UploadFileController.
2119
*/
2220
class UploadFileController extends Controller
2321
{
@@ -155,14 +153,14 @@ protected function callFileUrl($url)
155153
try {
156154
$response = $this->client->get($url);
157155
if ($response->getStatusCode() != 200) {
158-
throw new StoreResourceFailedException("Validation Error", [
159-
'url' => "The url seems unreachable",
156+
throw new StoreResourceFailedException('Validation Error', [
157+
'url' => 'The url seems unreachable',
160158
]);
161159
}
162160

163161
return $response;
164162
} catch (TransferException $e) {
165-
throw new StoreResourceFailedException("Validation Error", [
163+
throw new StoreResourceFailedException('Validation Error', [
166164
'url' => 'The url seems to be unreachable: '.$e->getCode(),
167165
]);
168166
}
@@ -174,7 +172,7 @@ protected function callFileUrl($url)
174172
protected function validateMime($mime)
175173
{
176174
if (! array_key_exists($mime, $this->validMimes)) {
177-
throw new StoreResourceFailedException("Validation Error", [
175+
throw new StoreResourceFailedException('Validation Error', [
178176
'Content-Type' => 'The Content Type sent is not valid',
179177
]);
180178
}

app/Providers/ErrorHandlerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function register()
3737
return $this->response->errorNotFound('404 Not Found');
3838
});
3939
app('Dingo\Api\Exception\Handler')->register(function (BodyTooLargeException $exception) {
40-
return $this->response->error("The body is too large", 413);
40+
return $this->response->error('The body is too large', 413);
4141
});
4242
}
4343
}

app/Transformers/Assets/AssetTransformer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
use League\Fractal\TransformerAbstract;
77

88
/**
9-
* Class AssetTransformer
10-
*
11-
* @package App\Transformers\Assets
9+
* Class AssetTransformer.
1210
*/
1311
class AssetTransformer extends TransformerAbstract
1412
{
@@ -26,6 +24,4 @@ public function transform(Asset $model)
2624
'created_at' => $model->created_at->toIso8601String(),
2725
];
2826
}
29-
30-
3127
}

0 commit comments

Comments
 (0)