Skip to content

Commit 116fc3b

Browse files
committed
Merge pull request #112 from marcteyssier/2.0
fix bug on null type
2 parents 6d93bcf + fa487a3 commit 116fc3b

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src-dev/views/instances/defaultRenderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,10 @@ MoufDefaultRenderer = (function () {
897897
var first = true;
898898
var types = moufTypes.getTypes();
899899
_.each(types, function(type) {
900+
// Do not display null type
901+
if(type == 'null') {
902+
return;
903+
}
900904
var selected = false;
901905
if (type == currentType) {
902906
selected = true;
@@ -1396,4 +1400,4 @@ MoufDefaultRenderer = (function () {
13961400
}
13971401
})();
13981402

1399-
})();
1403+
})();

src/Mouf/MoufManager.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,11 +2152,15 @@ private function walkConstructorLoop($instanceName, array $path) {
21522152
if($constructorArg['parametertype'] == 'object') {
21532153
if(is_array($constructorArg['value'])) {
21542154
foreach ($constructorArg['value'] as $subInstanceName) {
2155-
$this->walkConstructorLoop($subInstanceName, $path);
2155+
if($subInstanceName !== null) {
2156+
$this->walkConstructorLoop($subInstanceName, $path);
2157+
}
21562158
}
21572159
}
21582160
else {
2159-
$this->walkConstructorLoop($constructorArg['value'], $path);
2161+
if($constructorArg['value'] !== null) {
2162+
$this->walkConstructorLoop($constructorArg['value'], $path);
2163+
}
21602164
}
21612165
}
21622166
}

src/Mouf/Reflection/TypeDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function resolveType($useMap, $namespace) {
233233
*/
234234
public function isPrimitiveType() {
235235
$lowerVarType = strtolower($this->type);
236-
return in_array($lowerVarType, array('string', 'char', 'bool', 'boolean', 'int', 'integer', 'double', 'float', 'real', 'mixed', 'number'));
236+
return in_array($lowerVarType, array('string', 'char', 'bool', 'boolean', 'int', 'integer', 'double', 'float', 'real', 'mixed', 'number', 'null'));
237237
}
238238

239239
/**
@@ -332,4 +332,4 @@ private static function getNthTokenWithoutWhitespace($tokens, $i) {
332332
}
333333
return null;
334334
}
335-
}
335+
}

0 commit comments

Comments
 (0)