File tree Expand file tree Collapse file tree 3 files changed +19
-23
lines changed Expand file tree Collapse file tree 3 files changed +19
-23
lines changed Original file line number Diff line number Diff 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 (
@@ -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 }
Original file line number Diff line number Diff 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 (
@@ -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 }
Original file line number Diff line number Diff line change @@ -93,8 +93,8 @@ private function compileFilters(array ...$filters): Node\Expr
9393 public function getBuilder (array $ config ): Builder
9494 {
9595 $ builder = (new Akeneo \Builder \Capacity \Lookup \All ())
96- ->withType ((string ) $ config ['type ' ])
9796 ->withEndpoint (new Node \Identifier (sprintf ('get%sApi ' , ucfirst ((string ) $ config ['type ' ]))))
97+ ->withType ($ config ['type ' ])
9898 ;
9999
100100 if (isset ($ config ['search ' ]) && \is_array ($ config ['search ' ])) {
You can’t perform that action at this time.
0 commit comments