@@ -25,8 +25,7 @@ |
||
| 25 | 25 | $phar->stopBuffering (); |
| 26 | 26 | |
| 27 | 27 | |
| 28 | -} |
|
| 29 | -catch ( Exception $e ) |
|
| 28 | +} catch ( Exception $e ) |
|
| 30 | 29 | { |
| 31 | 30 | echo $e; |
| 32 | 31 | } |
| 33 | 32 | \ No newline at end of file |
@@ -35,26 +35,19 @@ |
||
| 35 | 35 | $res = ''; |
| 36 | 36 | if ( preg_match ( '/(tinyint\(1\)|bit)/', $str ) ) { |
| 37 | 37 | $res = 'boolean'; |
| 38 | - } |
|
| 39 | - elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) { |
|
| 38 | + } elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) { |
|
| 40 | 39 | $res = 'string'; |
| 41 | - } |
|
| 42 | - elseif ( preg_match ( '/(text)/', $str ) ) { |
|
| 40 | + } elseif ( preg_match ( '/(text)/', $str ) ) { |
|
| 43 | 41 | $res = 'text'; |
| 44 | - } |
|
| 45 | - elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) { |
|
| 42 | + } elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) { |
|
| 46 | 43 | $res = 'float'; |
| 47 | - } |
|
| 48 | - elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) { |
|
| 44 | + } elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) { |
|
| 49 | 45 | $res = $matches[ 1 ]; |
| 50 | - } |
|
| 51 | - elseif ( preg_match ( '/(date)/', $str ) ) { |
|
| 46 | + } elseif ( preg_match ( '/(date)/', $str ) ) { |
|
| 52 | 47 | $res = 'date'; |
| 53 | - } |
|
| 54 | - elseif ( preg_match ( '/(datetime)/', $str ) ) { |
|
| 48 | + } elseif ( preg_match ( '/(datetime)/', $str ) ) { |
|
| 55 | 49 | $res = 'datetime'; |
| 56 | - } |
|
| 57 | - else { |
|
| 50 | + } else { |
|
| 58 | 51 | print "Can't convert column type to Simple - Unrecognized type: $str"; |
| 59 | 52 | } |
| 60 | 53 | |
@@ -85,8 +85,7 @@ |
||
| 85 | 85 | $arg = getopt ( null, $arrValid ); |
| 86 | 86 | if ( array_key_exists ( 'init', $arg ) ) { |
| 87 | 87 | $maker = new \Classes\MakerConfigFile( $arg, dirname($_path) ); |
| 88 | - } |
|
| 89 | - else { |
|
| 88 | + } else { |
|
| 90 | 89 | $maker = new \Classes\MakerFile( new \Classes\Config( $arg, dirname($_path), count ( $argv ) ) ); |
| 91 | 90 | } |
| 92 | 91 | |
@@ -174,9 +174,12 @@ discard block |
||
| 174 | 174 | * Stored in ISO 8601 format. |
| 175 | 175 | * |
| 176 | 176 | * @param string|Zend_Date $<?= $column->getName () . "\n" ?> |
| 177 | -<?php else: ?> |
|
| 177 | +<?php else { |
|
| 178 | + : ?> |
|
| 178 | 179 | * @param <?= $column->getType () ?> $<?= $column->getName () . "\n" ?> |
| 179 | -<?php endif; ?> |
|
| 180 | +<?php endif; |
|
| 181 | +} |
|
| 182 | +?> |
|
| 180 | 183 | * @return <?= $className . "\n" ?> |
| 181 | 184 | */ |
| 182 | 185 | public function set<?= \Classes\Maker\AbstractMaker::getClassName ( $column->getName () ) ?>( $<?= $column->getName ( |
@@ -236,9 +239,12 @@ discard block |
||
| 236 | 239 | <?php if ( $column->equalType ( 'date' ) or $column->equalType ( 'datetime' ) or $column->equalType ( 'timestamp' ) ): ?> |
| 237 | 240 | * @param boolean $returnZendDate |
| 238 | 241 | * @return Zend_Date|null|string Zend_Date representation of this datetime if enabled, or ISO 8601 string if not |
| 239 | -<?php else: ?> |
|
| 242 | +<?php else { |
|
| 243 | + : ?> |
|
| 240 | 244 | * @return <?= $column->getType () . "\n" ?> |
| 241 | -<?php endif; ?> |
|
| 245 | +<?php endif; |
|
| 246 | +} |
|
| 247 | +?> |
|
| 242 | 248 | */ |
| 243 | 249 | public function get<?= \Classes\Maker\AbstractMaker::getClassName ( |
| 244 | 250 | $column->getName () |