|
Revision 12141, 1.6 kB
(checked in by fabien, 5 years ago)
|
[1.2] fixed coding standard of default Propel generated empty classes
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
require_once 'propel/engine/builder/om/php5/PHP5ExtensionPeerBuilder.php'; |
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
class SfExtensionPeerBuilder extends PHP5ExtensionPeerBuilder |
|---|
| 20 |
{ |
|---|
| 21 |
public function build() |
|---|
| 22 |
{ |
|---|
| 23 |
$code = parent::build(); |
|---|
| 24 |
if (!DataModelBuilder::getBuildProperty('builderAddComments')) |
|---|
| 25 |
{ |
|---|
| 26 |
$code = sfToolkit::stripComments($code); |
|---|
| 27 |
} |
|---|
| 28 |
|
|---|
| 29 |
return $code; |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
protected function addIncludes(&$script) |
|---|
| 33 |
{ |
|---|
| 34 |
if (!DataModelBuilder::getBuildProperty('builderAddIncludes')) |
|---|
| 35 |
{ |
|---|
| 36 |
return; |
|---|
| 37 |
} |
|---|
| 38 |
|
|---|
| 39 |
parent::addIncludes($script); |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
* Adds class phpdoc comment and openning of class. |
|---|
| 44 |
* |
|---|
| 45 |
* @param string &$script The script will be modified in this method |
|---|
| 46 |
*/ |
|---|
| 47 |
protected function addClassOpen(&$script) |
|---|
| 48 |
{ |
|---|
| 49 |
parent::addClassOpen($script); |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
$script = str_replace(array(" {\n", "\n\n\n"), array("\n{", "\n"), sfToolkit::stripComments($script)); |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
* Closes class. |
|---|
| 57 |
* |
|---|
| 58 |
* @param string &$script The script will be modified in this method |
|---|
| 59 |
*/ |
|---|
| 60 |
protected function addClassClose(&$script) |
|---|
| 61 |
{ |
|---|
| 62 |
parent::addClassClose($script); |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
$script = preg_replace('#} // .+$#m', '}', $script); |
|---|
| 66 |
} |
|---|
| 67 |
} |
|---|
| 68 |
|
|---|