Skip to content

Commit 6d0a8ed

Browse files
authored
Merge pull request #37 from sander3/php-cs-fixer-feature
Applied CS fixes
2 parents 183fe19 + d5b5149 commit 6d0a8ed

13 files changed

+53
-36
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
.DS_Store
2+
.php-cs-fixer.cache
13
/vendor
24
composer.lock
3-
.DS_Store
45
Thumbs.db

.php-cs-fixer.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
$excluded_folders = [
4+
'node_modules',
5+
'storage',
6+
'vendor',
7+
];
8+
9+
$finder = PhpCsFixer\Finder::create()
10+
->exclude($excluded_folders)
11+
->in(__DIR__);
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@Symfony' => true,
16+
'binary_operator_spaces' => [
17+
'operators' => [
18+
'=>' => 'align_single_space_minimal',
19+
],
20+
],
21+
'array_syntax' => ['syntax' => 'short'],
22+
'linebreak_after_opening_tag' => true,
23+
'not_operator_with_successor_space' => true,
24+
'ordered_imports' => ['sort_algorithm' => 'length'],
25+
'phpdoc_order' => true,
26+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
27+
])
28+
->setFinder($finder)
29+
;

config/gdpr.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
return [
4-
54
/*
65
|--------------------------------------------------------------------------
76
| Prefix URI
@@ -52,11 +51,9 @@
5251
*/
5352

5453
'cleanup' => [
55-
5654
'strategy' => 'Soved\Laravel\Gdpr\Jobs\Cleanup\Strategies\DefaultStrategy',
5755

5856
'defaultStrategy' => [
59-
6057
/*
6158
* The number of months for which inactive users must be kept.
6259
*/
@@ -66,9 +63,6 @@
6663
* The number of days before deletion at which inactive users will be notified.
6764
*/
6865
'notifyUsersDaysBeforeDeletion' => 14,
69-
7066
],
71-
7267
],
73-
7468
];

src/EncryptsAttributes.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ trait EncryptsAttributes
77
/**
88
* Get a plain attribute (not a relationship).
99
*
10-
* @param string $key
10+
* @param string $key
11+
*
1112
* @return mixed
1213
*/
1314
public function getAttributeValue($key)
1415
{
1516
$value = parent::getAttributeValue($key);
1617

1718
if (in_array($key, $this->encrypted) &&
18-
!is_null($value)) {
19+
! is_null($value)) {
1920
return decrypt($value);
2021
}
2122

@@ -25,16 +26,17 @@ public function getAttributeValue($key)
2526
/**
2627
* Set a given attribute on the model.
2728
*
28-
* @param string $key
29-
* @param mixed $value
29+
* @param string $key
30+
* @param mixed $value
31+
*
3032
* @return $this
3133
*/
3234
public function setAttribute(
3335
$key,
3436
$value
3537
) {
3638
if (in_array($key, $this->encrypted) &&
37-
!is_null($value)) {
39+
! is_null($value)) {
3840
$value = encrypt($value);
3941
}
4042

src/Events/GdprDownloaded.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class GdprDownloaded
1717
/**
1818
* Create a new event instance.
1919
*
20-
* @param \App\Authenticatable $user
20+
* @param \App\Authenticatable $user
21+
*
2122
* @return void
2223
*/
2324
public function __construct(Authenticatable $user)

src/Events/GdprInactiveUser.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class GdprInactiveUser
1717
/**
1818
* Create a new event instance.
1919
*
20-
* @param \Illuminate\Contracts\Auth\Authenticatable $user
2120
* @return void
2221
*/
2322
public function __construct(Authenticatable $user)

src/Events/GdprInactiveUserDeleted.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class GdprInactiveUserDeleted
1717
/**
1818
* Create a new event instance.
1919
*
20-
* @param \App\Authenticatable $user
20+
* @param \App\Authenticatable $user
21+
*
2122
* @return void
2223
*/
2324
public function __construct(Authenticatable $user)

src/GdprServiceProvider.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function registerRoutes()
3131
'namespace' => 'Soved\Laravel\Gdpr\Http\Controllers',
3232
'middleware' => config('gdpr.middleware'),
3333
], function () {
34-
$this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
34+
$this->loadRoutesFrom(__DIR__.'/../routes/web.php');
3535
});
3636
}
3737

@@ -68,7 +68,8 @@ public function register()
6868
protected function configure()
6969
{
7070
$this->mergeConfigFrom(
71-
__DIR__ . '/../config/gdpr.php', 'gdpr'
71+
__DIR__.'/../config/gdpr.php',
72+
'gdpr'
7273
);
7374
}
7475

@@ -81,7 +82,7 @@ protected function offerPublishing()
8182
{
8283
if ($this->app->runningInConsole()) {
8384
$this->publishes([
84-
__DIR__ . '/../config/gdpr.php' => config_path('gdpr.php'),
85+
__DIR__.'/../config/gdpr.php' => config_path('gdpr.php'),
8586
], 'gdpr-config');
8687
}
8788
}

src/Http/Controllers/GdprController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ class GdprController extends Controller
1313
/**
1414
* Download the GDPR compliant data portability JSON file.
1515
*
16-
* @param \Soved\Laravel\Gdpr\Http\Requests\GdprDownload $request
1716
* @return \Illuminate\Http\JsonResponse
1817
*/
1918
public function download(GdprDownload $request)
2019
{
21-
if (!$this->validateRequest($request)) {
20+
if (! $this->validateRequest($request)) {
2221
return $this->sendFailedLoginResponse();
2322
}
2423

@@ -40,7 +39,6 @@ public function download(GdprDownload $request)
4039
/**
4140
* Validate the request.
4241
*
43-
* @param \Illuminate\Foundation\Http\FormRequest $request
4442
* @return bool
4543
*/
4644
protected function validateRequest(FormRequest $request)
@@ -55,7 +53,6 @@ protected function validateRequest(FormRequest $request)
5553
/**
5654
* Validate a user's credentials.
5755
*
58-
* @param \Illuminate\Foundation\Http\FormRequest $request
5956
* @return bool
6057
*/
6158
protected function hasValidCredentials(FormRequest $request)

src/Jobs/Cleanup/CleanupJob.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
class CleanupJob implements ShouldQueue
1313
{
14-
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
14+
use Dispatchable;
15+
use InteractsWithQueue;
16+
use Queueable;
17+
use SerializesModels;
1518

1619
/**
1720
* @var \Illuminate\Database\Eloquent\Collection
@@ -26,8 +29,8 @@ class CleanupJob implements ShouldQueue
2629
/**
2730
* Create a new job instance.
2831
*
29-
* @param \Illuminate\Database\Eloquent\Collection $users
30-
* @param \Soved\Laravel\Gdpr\Jobs\Cleanup\CleanupStrategy $strategy
32+
* @param \Soved\Laravel\Gdpr\Jobs\Cleanup\CleanupStrategy $strategy
33+
*
3134
* @return void
3235
*/
3336
public function __construct(

0 commit comments

Comments
 (0)