File tree Expand file tree Collapse file tree 8 files changed +32
-11
lines changed Expand file tree Collapse file tree 8 files changed +32
-11
lines changed Original file line number Diff line number Diff line change 22
22
"spatie/laravel-package-tools" : " ^1.13.0"
23
23
},
24
24
"require-dev" : {
25
+ "driftingly/rector-laravel" : " ^0.17.0" ,
25
26
"laravel/pint" : " ^1.7" ,
26
27
"nunomaduro/collision" : " ^7.3.3" ,
27
28
"nunomaduro/larastan" : " ^2.5.1" ,
28
29
"orchestra/testbench" : " ^8.0.11" ,
29
30
"phpstan/extension-installer" : " ^1.2" ,
30
31
"phpstan/phpstan-deprecation-rules" : " ^1.1.3" ,
31
32
"phpstan/phpstan-phpunit" : " ^1.3.10" ,
32
- "phpunit/phpunit" : " ^10.0.18"
33
+ "phpunit/phpunit" : " ^10.0.18" ,
34
+ "rector/rector" : " ^0.15.23"
33
35
},
34
36
"autoload" : {
35
37
"psr-4" : {
52
54
"analyse" : " vendor/bin/phpstan analyse" ,
53
55
"test" : " vendor/bin/phpunit" ,
54
56
"test-coverage" : " vendor/bin/phpunit --coverage" ,
55
- "format" : " vendor/bin/pint"
57
+ "format" : " vendor/bin/pint" ,
58
+ "rector" : " vendor/bin/rector process"
56
59
},
57
60
"config" : {
58
61
"sort-packages" : true ,
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ use Rector \Config \RectorConfig ;
6
+ use Rector \Set \ValueObject \LevelSetList ;
7
+ use RectorLaravel \Set \LaravelSetList ;
8
+
9
+ return static function (RectorConfig $ rectorConfig ): void {
10
+ $ rectorConfig ->paths ([
11
+ __DIR__ .'/config ' ,
12
+ __DIR__ .'/src ' ,
13
+ __DIR__ .'/tests ' ,
14
+ ]);
15
+
16
+ $ rectorConfig ->sets ([
17
+ LevelSetList::UP_TO_PHP_81 ,
18
+ LaravelSetList::LARAVEL_100 ,
19
+ ]);
20
+ };
Original file line number Diff line number Diff line change @@ -43,8 +43,6 @@ public function disableEventListener(): void
43
43
44
44
public function listensToEvents (): bool
45
45
{
46
- return self ::$ listenToEvents !== null
47
- ? self ::$ listenToEvents
48
- : config ('elastica-bridge.events.listen ' , true );
46
+ return self ::$ listenToEvents ?? config ('elastica-bridge.events.listen ' , true );
49
47
}
50
48
}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function handle(): int
57
57
if ($ hasBlueGreen ) {
58
58
try {
59
59
$ activeBlueGreen = $ indexConfig ->getBlueGreenActiveElasticaIndex ()->getName ();
60
- } catch (BlueGreenIndicesIncorrectlySetupException $ exception ) {
60
+ } catch (BlueGreenIndicesIncorrectlySetupException ) {
61
61
$ hasBlueGreen = false ;
62
62
}
63
63
}
Original file line number Diff line number Diff line change 10
10
class EventHandler
11
11
{
12
12
public function __construct (
13
- private ElasticaClient $ elasticaClient ,
14
- private ModelEventListener $ modelEventListener
13
+ private readonly ElasticaClient $ elasticaClient ,
14
+ private readonly ModelEventListener $ modelEventListener
15
15
) {
16
16
}
17
17
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ final public function getBlueGreenInactiveElasticaIndex(): Index
172
172
173
173
final public function indexingLock (): Lock
174
174
{
175
- return Cache::lock (__CLASS__ .$ this ->getName ());
175
+ return Cache::lock (self ::class .$ this ->getName ());
176
176
}
177
177
178
178
public function ingoreIndexingErrors (): bool
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ private function setup(ElasticaClient $elastica): void
83
83
{
84
84
try {
85
85
$ this ->indexConfig ->getBlueGreenActiveSuffix ();
86
- } catch (BlueGreenIndicesIncorrectlySetupException $ exception ) {
86
+ } catch (BlueGreenIndicesIncorrectlySetupException ) {
87
87
$ elastica ->getIndex ($ this ->indexConfig ->getName ().IndexInterface::INDEX_SUFFIX_BLUE )->addAlias ($ this ->indexConfig ->getName ());
88
88
}
89
89
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class ModelEventListener
22
22
23
23
private const EVENT_DELETED = 'deleted ' ;
24
24
25
- public const EVENTS = [
25
+ final public const EVENTS = [
26
26
self ::EVENT_CREATED ,
27
27
self ::EVENT_UPDATED ,
28
28
self ::EVENT_SAVED ,
You can’t perform that action at this time.
0 commit comments