@@ -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 |
@@ -140,9 +140,12 @@ discard block |
||
140 | 140 | * Stored in ISO 8601 format. |
141 | 141 | * |
142 | 142 | * @param string|Zend_Date $<?=$column->getName() . "\n"?> |
143 | -<?php else: ?> |
|
143 | +<?php else { |
|
144 | + : ?> |
|
144 | 145 | * @param <?=$column->getType()?> $<?=$column->getName() . "\n"?> |
145 | -<?php endif; ?> |
|
146 | +<?php endif; |
|
147 | +} |
|
148 | +?> |
|
146 | 149 | * @return <?=$className . "\n"?> |
147 | 150 | */ |
148 | 151 | public function set<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>($<?=$column->getName()?>) |
@@ -189,9 +192,12 @@ discard block |
||
189 | 192 | <?php if ($column->getType()=='date'): ?> |
190 | 193 | * @param boolean $returnZendDate |
191 | 194 | * @return Zend_Date|null|string Zend_Date representation of this datetime if enabled, or ISO 8601 string if not |
192 | -<?php else: ?> |
|
195 | +<?php else { |
|
196 | + : ?> |
|
193 | 197 | * @return <?=$column->getType() . "\n"?> |
194 | -<?php endif; ?> |
|
198 | +<?php endif; |
|
199 | +} |
|
200 | +?> |
|
195 | 201 | */ |
196 | 202 | public function get<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>(<?php if ($column->getType()=='date'): ?>$returnZendDate = false <?php endif;?>) |
197 | 203 | { |
@@ -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 |
@@ -79,8 +79,7 @@ |
||
79 | 79 | $arg = getopt ( null, $arrValid ); |
80 | 80 | if ( array_key_exists ( 'init', $arg ) ) { |
81 | 81 | $maker = new \Classes\MakerConfigFile( $arg, $_path ); |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) ); |
85 | 84 | } |
86 | 85 |