Fixing issue with EntityGenerator spaces
This commit is contained in:
parent
3afc8f794a
commit
ac4e33d056
@ -192,8 +192,7 @@ public function <methodName>()
|
|||||||
'<use>',
|
'<use>',
|
||||||
'<entityAnnotation>',
|
'<entityAnnotation>',
|
||||||
'<entityClassName>',
|
'<entityClassName>',
|
||||||
'<entityBody>',
|
'<entityBody>'
|
||||||
'<spaces>'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$replacements = array(
|
$replacements = array(
|
||||||
@ -201,11 +200,11 @@ public function <methodName>()
|
|||||||
$this->_generateEntityUse($metadata),
|
$this->_generateEntityUse($metadata),
|
||||||
$this->_generateEntityDocBlock($metadata),
|
$this->_generateEntityDocBlock($metadata),
|
||||||
$this->_generateEntityClassName($metadata),
|
$this->_generateEntityClassName($metadata),
|
||||||
$this->_generateEntityBody($metadata),
|
$this->_generateEntityBody($metadata)
|
||||||
$this->_spaces
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return str_replace($placeHolders, $replacements, self::$_classTemplate);
|
$code = str_replace($placeHolders, $replacements, self::$_classTemplate);
|
||||||
|
return str_replace('<spaces>', $this->_spaces, $code);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -220,9 +219,10 @@ public function <methodName>()
|
|||||||
$currentCode = file_get_contents($path);
|
$currentCode = file_get_contents($path);
|
||||||
|
|
||||||
$body = $this->_generateEntityBody($metadata);
|
$body = $this->_generateEntityBody($metadata);
|
||||||
|
$body = str_replace('<spaces>', $this->_spaces, $body);
|
||||||
$last = strrpos($currentCode, '}');
|
$last = strrpos($currentCode, '}');
|
||||||
|
|
||||||
return substr($currentCode, 0, $last) . $body . '}';
|
return substr($currentCode, 0, $last) . $body . "\n}";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user