Skip to content

Commit 940910b

Browse files
committed
raise min MSI,
[rector] Rector fixes, avoid case where we build "is_null(null)"
1 parent 78d8dff commit 940910b

File tree

13 files changed

+48
-53
lines changed

13 files changed

+48
-53
lines changed

infection.json.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"@default": true
2121
},
2222
"testFramework":"phpunit",
23-
"minMsi": 30,
24-
"minCoveredMsi": 40
23+
"minMsi": 50,
24+
"minCoveredMsi": 60
2525
}

src/Builder/Capacity/Extractor/ListPerPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getNode(): Node
8888
new Node\Stmt\Expression(
8989
expr: new Node\Expr\Yield_(
9090
value: new Node\Expr\New_(
91-
class: new Node\Name\FullyQualified(name: 'Kiboko\\Component\\Bucket\\AcceptanceResultBucket'),
91+
class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class),
9292
args: [
9393
new Node\Arg(
9494
new Node\Expr\Variable('item')
@@ -99,7 +99,7 @@ class: new Node\Name\FullyQualified(name: 'Kiboko\\Component\\Bucket\\Acceptance
9999
),
100100
],
101101
],
102-
);
102+
);
103103
}
104104

105105
private function compileSearch(): array

src/Builder/Capacity/Loader/Upsert.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getNode(): Node
9494
var: new Node\Expr\Variable('line'),
9595
expr: new Node\Expr\Yield_(
9696
value: new Node\Expr\New_(
97-
class: new Node\Name\FullyQualified(name: 'Kiboko\\Component\\Bucket\\AcceptanceResultBucket'),
97+
class: new Node\Name\FullyQualified(name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class),
9898
args: [
9999
new Node\Arg(
100100
value: new Node\Expr\Variable('line'),
@@ -109,7 +109,7 @@ class: new Node\Name\FullyQualified(name: 'Kiboko\\Component\\Bucket\\Acceptance
109109
new Node\Stmt\Catch_(
110110
types: [
111111
new Node\Name\FullyQualified(
112-
name: 'Akeneo\\Pim\\ApiClient\\Exception\\HttpException',
112+
name: \Akeneo\Pim\ApiClient\Exception\HttpException::class,
113113
),
114114
],
115115
var: new Node\Expr\Variable('exception'),

src/Builder/Capacity/Lookup/All.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ public function getNode(): Node
5757
return (new IsolatedValueAppendingBuilder(
5858
new Node\Expr\Variable('input'),
5959
new Node\Expr\Variable('lookup'),
60-
[
61-
new Node\Stmt\If_(
60+
array_filter([
61+
$this->code ? new Node\Stmt\If_(
6262
cond: new Node\Expr\FuncCall(
6363
name: new Node\Name('is_null'),
64-
args: array_filter(
65-
[
66-
null !== $this->code ? new Node\Arg(
67-
value: $this->code,
68-
) : null,
69-
],
70-
),
64+
args: [
65+
new Node\Arg(
66+
value: $this->code,
67+
),
68+
],
7169
),
7270
subNodes: [
7371
'stmts' => [
@@ -78,7 +76,7 @@ public function getNode(): Node
7876
),
7977
],
8078
],
81-
),
79+
) : null,
8280
new Node\Stmt\TryCatch(
8381
stmts: [
8482
new Node\Stmt\Expression(
@@ -117,7 +115,7 @@ public function getNode(): Node
117115
catches: [
118116
new Node\Stmt\Catch_(
119117
types: [
120-
new Node\Name\FullyQualified('Akeneo\Pim\ApiClient\Exception\HttpException'),
118+
new Node\Name\FullyQualified(\Akeneo\Pim\ApiClient\Exception\HttpException::class),
121119
],
122120
var: new Node\Expr\Variable('exception'),
123121
stmts: [
@@ -169,7 +167,7 @@ public function getNode(): Node
169167
new Node\Stmt\Return_(
170168
expr: new Node\Expr\Variable('items'),
171169
),
172-
],
170+
]),
173171
new Node\Expr\Variable('bucket')
174172
))->getNode();
175173
}

src/Builder/Capacity/Lookup/ListPerPage.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ public function getNode(): Node
5757
return (new IsolatedValueAppendingBuilder(
5858
new Node\Expr\Variable('input'),
5959
new Node\Expr\Variable('lookup'),
60-
[
61-
new Node\Stmt\If_(
60+
array_filter([
61+
$this->code ? new Node\Stmt\If_(
6262
cond: new Node\Expr\FuncCall(
6363
name: new Node\Name('is_null'),
64-
args: array_filter(
65-
[
66-
null !== $this->code ? new Node\Arg(
67-
value: $this->code,
68-
) : null,
69-
],
70-
),
64+
args: [
65+
new Node\Arg(
66+
value: $this->code,
67+
),
68+
],
7169
),
7270
subNodes: [
7371
'stmts' => [
@@ -78,7 +76,7 @@ public function getNode(): Node
7876
),
7977
],
8078
],
81-
),
79+
) : null,
8280
new Node\Stmt\TryCatch(
8381
stmts: [
8482
new Node\Stmt\Expression(
@@ -117,7 +115,7 @@ public function getNode(): Node
117115
catches: [
118116
new Node\Stmt\Catch_(
119117
types: [
120-
new Node\Name\FullyQualified('Akeneo\Pim\ApiClient\Exception\HttpException'),
118+
new Node\Name\FullyQualified(\Akeneo\Pim\ApiClient\Exception\HttpException::class),
121119
],
122120
var: new Node\Expr\Variable('exception'),
123121
stmts: [
@@ -169,7 +167,7 @@ public function getNode(): Node
169167
new Node\Stmt\Return_(
170168
expr: new Node\Expr\Variable('items'),
171169
),
172-
],
170+
]),
173171
new Node\Expr\Variable('bucket')
174172
))->getNode();
175173
}

src/Builder/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function withFileSystem(Node\Expr $fileSystem): self
7070
public function getNode(): Node\Expr\MethodCall
7171
{
7272
$instance = new Node\Expr\New_(
73-
new Node\Name\FullyQualified('Akeneo\\Pim\\ApiClient\\AkeneoPimClientBuilder'),
73+
new Node\Name\FullyQualified(\Akeneo\Pim\ApiClient\AkeneoPimClientBuilder::class),
7474
[
7575
new Node\Arg($this->baseUrl),
7676
],

src/Builder/ConditionalLookup.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function compileAllAlternatives(): Node
7474
expr: new Node\Expr\Assign(
7575
var: new Node\Expr\Variable('bucket'),
7676
expr: new Node\Expr\New_(
77-
new Node\Name\FullyQualified('Kiboko\Component\Bucket\ComplexResultBucket')
77+
new Node\Name\FullyQualified(\Kiboko\Component\Bucket\ComplexResultBucket::class)
7878
)
7979
)
8080
),
@@ -126,7 +126,7 @@ class: new Node\Stmt\Class_(
126126
name: null,
127127
subNodes: [
128128
'implements' => [
129-
new Node\Name\FullyQualified(name: 'Kiboko\\Contract\\Pipeline\\TransformerInterface'),
129+
new Node\Name\FullyQualified(name: \Kiboko\Contract\Pipeline\TransformerInterface::class),
130130
],
131131
'stmts' => [
132132
new Node\Stmt\ClassMethod(
@@ -136,12 +136,12 @@ class: new Node\Stmt\Class_(
136136
'params' => [
137137
new Node\Param(
138138
var: new Node\Expr\Variable('client'),
139-
type: new Node\Name\FullyQualified(name: 'Akeneo\\Pim\\ApiClient\\AkeneoPimClientInterface'),
139+
type: new Node\Name\FullyQualified(name: \Akeneo\Pim\ApiClient\AkeneoPimClientInterface::class),
140140
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
141141
),
142142
new Node\Param(
143143
var: new Node\Expr\Variable('logger'),
144-
type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'),
144+
type: new Node\Name\FullyQualified(name: \Psr\Log\LoggerInterface::class),
145145
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
146146
),
147147
],
@@ -170,7 +170,7 @@ class: new Node\Stmt\Class_(
170170
),
171171
args: [
172172
new Node\Arg(value: $this->client),
173-
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
173+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))),
174174
],
175175
);
176176
}

src/Builder/Extractor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class: new Node\Stmt\Class_(
4949
name: null,
5050
subNodes: [
5151
'implements' => [
52-
new Node\Name\FullyQualified(name: 'Kiboko\\Contract\\Pipeline\\ExtractorInterface'),
52+
new Node\Name\FullyQualified(name: \Kiboko\Contract\Pipeline\ExtractorInterface::class),
5353
],
5454
'stmts' => [
5555
new Node\Stmt\ClassMethod(
@@ -59,12 +59,12 @@ class: new Node\Stmt\Class_(
5959
'params' => [
6060
new Node\Param(
6161
var: new Node\Expr\Variable('client'),
62-
type: new Node\Name\FullyQualified(name: 'Akeneo\\Pim\\ApiClient\\AkeneoPimClientInterface'),
62+
type: new Node\Name\FullyQualified(name: \Akeneo\Pim\ApiClient\AkeneoPimClientInterface::class),
6363
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
6464
),
6565
new Node\Param(
6666
var: new Node\Expr\Variable('logger'),
67-
type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'),
67+
type: new Node\Name\FullyQualified(name: \Psr\Log\LoggerInterface::class),
6868
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
6969
),
7070
],
@@ -215,7 +215,7 @@ class: new Node\Stmt\Class_(
215215
),
216216
args: [
217217
new Node\Arg(value: $this->client),
218-
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
218+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))),
219219
],
220220
);
221221
}

src/Builder/Loader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class: new Node\Stmt\Class_(
4949
name: null,
5050
subNodes: [
5151
'implements' => [
52-
new Node\Name\FullyQualified(name: 'Kiboko\\Contract\\Pipeline\\LoaderInterface'),
52+
new Node\Name\FullyQualified(name: \Kiboko\Contract\Pipeline\LoaderInterface::class),
5353
],
5454
'stmts' => [
5555
new Node\Stmt\ClassMethod(
@@ -59,12 +59,12 @@ class: new Node\Stmt\Class_(
5959
'params' => [
6060
new Node\Param(
6161
var: new Node\Expr\Variable('client'),
62-
type: new Node\Name\FullyQualified(name: 'Akeneo\\Pim\\ApiClient\\AkeneoPimClientInterface'),
62+
type: new Node\Name\FullyQualified(name: \Akeneo\Pim\ApiClient\AkeneoPimClientInterface::class),
6363
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
6464
),
6565
new Node\Param(
6666
var: new Node\Expr\Variable('logger'),
67-
type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'),
67+
type: new Node\Name\FullyQualified(name: \Psr\Log\LoggerInterface::class),
6868
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
6969
),
7070
],
@@ -136,7 +136,7 @@ class: new Node\Stmt\Class_(
136136
),
137137
args: [
138138
new Node\Arg(value: $this->client),
139-
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
139+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))),
140140
],
141141
);
142142
}

src/Builder/Lookup.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class: new Node\Stmt\Class_(
6161
name: null,
6262
subNodes: [
6363
'implements' => [
64-
new Node\Name\FullyQualified(name: 'Kiboko\\Contract\\Pipeline\\TransformerInterface'),
64+
new Node\Name\FullyQualified(name: \Kiboko\Contract\Pipeline\TransformerInterface::class),
6565
],
6666
'stmts' => [
6767
new Node\Stmt\ClassMethod(
@@ -71,12 +71,12 @@ class: new Node\Stmt\Class_(
7171
'params' => [
7272
new Node\Param(
7373
var: new Node\Expr\Variable('client'),
74-
type: new Node\Name\FullyQualified(name: 'Akeneo\\Pim\\ApiClient\\AkeneoPimClientInterface'),
74+
type: new Node\Name\FullyQualified(name: \Akeneo\Pim\ApiClient\AkeneoPimClientInterface::class),
7575
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
7676
),
7777
new Node\Param(
7878
var: new Node\Expr\Variable('logger'),
79-
type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'),
79+
type: new Node\Name\FullyQualified(name: \Psr\Log\LoggerInterface::class),
8080
flags: Node\Stmt\Class_::MODIFIER_PUBLIC,
8181
),
8282
],
@@ -107,7 +107,7 @@ class: new Node\Stmt\Class_(
107107
expr: new Node\Expr\Assign(
108108
var: new Node\Expr\Variable('bucket'),
109109
expr: new Node\Expr\New_(
110-
new Node\Name\FullyQualified('Kiboko\Component\Bucket\ComplexResultBucket')
110+
new Node\Name\FullyQualified(\Kiboko\Component\Bucket\ComplexResultBucket::class)
111111
)
112112
)
113113
),
@@ -122,7 +122,7 @@ class: new Node\Stmt\Class_(
122122
),
123123
args: [
124124
new Node\Arg(value: $this->client),
125-
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
125+
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))),
126126
],
127127
);
128128
}

0 commit comments

Comments
 (0)