File tree 2 files changed +3
-4
lines changed
src/generator/builder/parts
2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ protected function writeParameters(RoutineInterface $model) {
41
41
42
42
protected function writeFunctionReturnType (RoutineInterface $ model ) {
43
43
$ type = $ this ->getType ($ model , $ this ->config ->getGenerateReturnTypeHints ());
44
- if ($ type !== null ) {
44
+ if ($ type !== null && $ this -> config -> getGenerateReturnTypeHints () ) {
45
45
$ this ->writer ->write (': ' )->write ($ type );
46
46
}
47
47
}
Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ trait TypeBuilderPart {
32
32
private function getType (AbstractModel $ model , $ allowed ) {
33
33
$ type = $ model ->getType ();
34
34
if (!empty ($ type ) && strpos ($ type , '| ' ) === false
35
- && (!in_array ($ type , self ::$ noTypeHints ) || (
36
- $ allowed && in_array ($ type , self ::$ php7typeHints ))
37
- )
35
+ && (!in_array ($ type , self ::$ noTypeHints )
36
+ || ($ allowed && in_array ($ type , self ::$ php7typeHints )))
38
37
) {
39
38
if (isset (self ::$ typeHintMap [$ type ])) {
40
39
return self ::$ typeHintMap [$ type ];
You can’t perform that action at this time.
0 commit comments