55namespace Kiboko \Plugin \CSV \Builder ;
66
77use Kiboko \Contract \Configurator \StepBuilderInterface ;
8- use PhpParser \Builder \Method ;
98use PhpParser \Node ;
109
1110final class Loader implements StepBuilderInterface
@@ -102,7 +101,7 @@ public function getNode(): Node
102101 $ arguments = [
103102 new Node \Arg (
104103 value: new Node \Expr \New_ (
105- class: $ this -> withNonStandard === true ?
104+ class: true === $ this -> withNonStandard ?
106105 new Node \Stmt \Class_ (
107106 name: 'SplFileObject ' ,
108107 subNodes: [
@@ -137,9 +136,11 @@ class: $this->withNonStandard === true ?
137136 type: 'string ' ,
138137 ),
139138 ],
140- 'returnType ' => new Node \Expr \BinaryOp \LogicalXor (
141- left: new Node \Expr \ConstFetch (new Node \Name ('int ' )),
142- right: new Node \Expr \ConstFetch (new Node \Name ('false ' )),
139+ 'returnType ' => new Node \UnionType (
140+ types: [
141+ new Node \Name ('int ' ),
142+ new Node \Name ('false ' ),
143+ ],
143144 ),
144145 'stmts ' => [
145146 new Node \Stmt \Return_ (
@@ -148,8 +149,8 @@ class: $this->withNonStandard === true ?
148149 name: 'fwrite ' ,
149150 args: [
150151 new Node \Arg (
151- value: new Node \Expr \AssignOp \Concat (
152- var : new Node \Expr \FuncCall (
152+ value: new Node \Expr \BinaryOp \Concat (
153+ left : new Node \Expr \FuncCall (
153154 name: new Node \Name ('implode ' ),
154155 args: [
155156 new Node \Arg (
@@ -160,7 +161,7 @@ class: $this->withNonStandard === true ?
160161 ),
161162 ],
162163 ),
163- expr : new Node \Expr \Variable ('eol ' )
164+ right : new Node \Expr \Variable ('eol ' )
164165 ),
165166 ),
166167 ],
0 commit comments