@@ -165,22 +165,22 @@ private function getSaveMethod(): CodegenMethod {
165165 )
166166 -> startIfBlock(' $id === null' )
167167 -> addLine(' $this->checkRequiredFields();' )
168- -> addLine(' $names = "(" .implode("," , $quoted->keys()).")" ;' )
169- -> addLine(' $values = "(" .implode("," , $quoted->values()).")" ;' )
168+ -> addLine(' $names = \' ( \' .implode(\' , \' , $quoted->keys()).\' ) \' ;' )
169+ -> addLine(' $values = \' ( \' .implode(\' , \' , $quoted->values()).\' ) \' ;' )
170170 -> addLinef(
171- ' $st = " insert into %s " .$names." values " .$values;' ,
171+ ' $st = \' insert into %s \' .$names.\' values \' .$values;' ,
172172 $this -> schema -> getTableName(),
173173 )
174174 -> addLine(' $conn->exec($st);' )
175175 -> addReturnf(' (int) $conn->lastInsertId()' )
176176 -> addElseBlock()
177177 -> addAssignment(
178178 ' $pairs' ,
179- ' $quoted->mapWithKey(($field, $value) ==> $field."=" .$value)' ,
179+ ' $quoted->mapWithKey(($field, $value) ==> $field.\' = \' .$value)' ,
180180 HackBuilderValues :: literal(),
181181 )
182182 -> addLinef(
183- ' $st = " update %s set " .implode("," , $pairs)." where %s=" .$this->id;' ,
183+ ' $st = \' update %s set \' .implode(\' , \' , $pairs).\' where %s=\' .$this->id;' ,
184184 $this -> schema -> getTableName(),
185185 $this -> schema -> getIdField(),
186186 )
@@ -219,8 +219,8 @@ private function getCheckRequiredFieldsMethod(): CodegenMethod {
219219 ' invariant' ,
220220 Vector {
221221 ' $missing->isEmpty()' ,
222- ' " The following required fields are missing: %s" ' ,
223- ' implode(", " , $missing)' ,
222+ ' \' The following required fields are missing: %s\' ' ,
223+ ' implode(\' , \' , $missing)' ,
224224 }
225225 );
226226
@@ -234,7 +234,7 @@ private function getSetters(): Vector<CodegenMethod> {
234234 $methods = Vector {};
235235 foreach ($this -> schema -> getFields() as $name => $field ) {
236236 if ($field -> getType() === ' DateTime' ) {
237- $value = ' $value->format(" Y-m-d" )' ;
237+ $value = ' $value->format(\' Y-m-d\' )' ;
238238 } else {
239239 $value = ' $value' ;
240240 }
@@ -250,7 +250,7 @@ private function getSetters(): Vector<CodegenMethod> {
250250 -> addInlineComment(' You may manually change this section of code' );
251251 }
252252 $body
253- -> addLinef(' $this->data["%s" ] = %s;' , $field -> getDbColumn(), $value );
253+ -> addLinef(' $this->data[\' %s \' ] = %s;' , $field -> getDbColumn(), $value );
254254
255255 if ($field -> isManual()) {
256256 // You always need to close a manual section
0 commit comments