Skip to content

Commit ccb58b9

Browse files
wb-hx510875yndu13
wb-hx510875
authored andcommitted
chore: improve
1 parent e9b0ae9 commit ccb58b9

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/langs/common/combinator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class BaseCombinator {
5050
}
5151
}
5252

53-
combineOutputParts(config, outputParts) {
53+
combineOutputParts(config, outputParts, append = false) {
5454
const globalEmitter = new Emitter(config);
5555
globalEmitter.emit(outputParts.head);
5656
globalEmitter.emit(outputParts.body);
5757
globalEmitter.emit(outputParts.foot);
58-
globalEmitter.save();
58+
globalEmitter.save(append);
5959
}
6060

6161
coreClass(objName) {

src/langs/php/package_info.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const BasePackageInfo = require('../common/package_info');
66

77
const { _deepClone, _render } = require('../../lib/helper');
88

9-
const OPTION_LOCAL = 1; // use local tmpl file to render content
10-
const OPTION_SOURCE = 2; // config by Darafile.{lang}.packageInfo
11-
const OPTION_RENDER = 4; // render content from tmpl
12-
const OPTION_UPDATE = 8; // update if file already exist
9+
const OPTION_LOCAL = 0b1; // use local tmpl file to render content
10+
const OPTION_SOURCE = 0b10; // config by Darafile.{lang}.packageInfo
11+
const OPTION_RENDER = 0b100; // render content from tmpl
12+
const OPTION_UPDATE = 0b1000; // update if file already exist
1313

1414
// file_name : OPTIONS
1515
const files = {

tests/expected/model/Models/MyModel.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class MyModel extends Model {
1717
protected $_name = [
1818
'name' => 'realName',
19-
'link' => 'personal_photo',
19+
'link' => 'link',
2020
];
2121
public function validate() {
2222
Model::validateRequired('stringfield', $this->stringfield, true);
@@ -205,7 +205,7 @@ public function toMap() {
205205
$res['uint64Field'] = $this->uint64Field;
206206
}
207207
if (null !== $this->link) {
208-
$res['personal_photo'] = $this->link;
208+
$res['link'] = $this->link;
209209
}
210210
return $res;
211211
}
@@ -338,8 +338,8 @@ public static function fromMap($map = []) {
338338
if(isset($map['uint64Field'])){
339339
$model->uint64Field = $map['uint64Field'];
340340
}
341-
if(isset($map['personal_photo'])){
342-
$model->link = $map['personal_photo'];
341+
if(isset($map['link'])){
342+
$model->link = $map['link'];
343343
}
344344
return $model;
345345
}

tests/fixtures/model/main.dara

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ model MyModel = {
4444
uint16Field: uint16,
4545
uint32Field: uint32,
4646
uint64Field: uint64,
47-
link?: string(name='personal_photo', example='http://*/*.png'),
47+
link?: string(name='link', example='http://*/*.png'),
4848
};

0 commit comments

Comments
 (0)