1
0
mirror of synced 2025-01-18 14:31:40 +03:00

Fixing issue with EntityGenerator spaces

This commit is contained in:
Jonathan H. Wage 2010-04-14 14:17:55 -04:00
parent 3afc8f794a
commit ac4e33d056

View File

@ -192,8 +192,7 @@ public function <methodName>()
'<use>',
'<entityAnnotation>',
'<entityClassName>',
'<entityBody>',
'<spaces>'
'<entityBody>'
);
$replacements = array(
@ -201,11 +200,11 @@ public function <methodName>()
$this->_generateEntityUse($metadata),
$this->_generateEntityDocBlock($metadata),
$this->_generateEntityClassName($metadata),
$this->_generateEntityBody($metadata),
$this->_spaces
$this->_generateEntityBody($metadata)
);
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);
$body = $this->_generateEntityBody($metadata);
$body = str_replace('<spaces>', $this->_spaces, $body);
$last = strrpos($currentCode, '}');
return substr($currentCode, 0, $last) . $body . '}';
return substr($currentCode, 0, $last) . $body . "\n}";
}
/**