GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( bf1ef2...cd89f1 )
by Pedro
10:51 queued 06:31
created
build/Classes/Db/Constrant.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -70,6 +70,9 @@
 block discarded – undo
70 70
         return $this;
71 71
     }
72 72
 
73
+    /**
74
+     * @return string
75
+     */
73 76
     public function getDatabase (){
74 77
         return $this->database;
75 78
     }
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
      *
22 22
      * @author Pedro Alarcao <[email protected]>
23 23
      */
24
-    final private function __construct ()
24
+    final private function __construct()
25 25
     {
26 26
     }
27 27
 
28
-    public static function getInstance ()
28
+    public static function getInstance()
29 29
     {
30 30
         return new self();
31 31
     }
@@ -55,34 +55,34 @@  discard block
 block discarded – undo
55 55
      *
56 56
      * @return Constrant
57 57
      */
58
-    public function populate ( $array )
58
+    public function populate($array)
59 59
     {
60
-        if ( isset( $array[ 'schema' ] ) )
60
+        if (isset($array['schema']))
61 61
         {
62
-            $this->schema = $array[ 'schema' ];
62
+            $this->schema = $array['schema'];
63 63
         }
64 64
 
65
-        $this->database = $array[ 'database' ];
66
-        $this->constrant = $array[ 'constrant' ];
67
-        $this->table = $array[ 'table' ];
68
-        $this->column = $array[ 'column' ];
65
+        $this->database = $array['database'];
66
+        $this->constrant = $array['constrant'];
67
+        $this->table = $array['table'];
68
+        $this->column = $array['column'];
69 69
 
70 70
         return $this;
71 71
     }
72 72
 
73
-    public function getDatabase (){
73
+    public function getDatabase() {
74 74
         return $this->database;
75 75
     }
76 76
 
77 77
     /**
78 78
      * @return string
79 79
      */
80
-    public function getNameConstrant ()
80
+    public function getNameConstrant()
81 81
     {
82 82
         return $this->constrant;
83 83
     }
84 84
 
85
-    public function hasSchema ()
85
+    public function hasSchema()
86 86
     {
87 87
         return (bool) $this->schema;
88 88
     }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     /**
91 91
      * @return string
92 92
      */
93
-    public function getSchema ()
93
+    public function getSchema()
94 94
     {
95 95
         return $this->schema;
96 96
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * @return string
100 100
      */
101
-    public function getTable ()
101
+    public function getTable()
102 102
     {
103 103
         return $this->table;
104 104
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     /**
107 107
      * @return string
108 108
      */
109
-    public function getColumn ()
109
+    public function getColumn()
110 110
     {
111 111
         return $this->column;
112 112
     }
Please login to merge, or discard this patch.
build/Classes/templates/zf1/entity.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,9 +140,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?= "<?php\n" ?>
2
-<?php $classNameModel = $objTables->getNamespace () . '_' . \Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () ) ?>
3
-<?php $className = $objTables->getNamespace () . '_Entity_' . \Classes\Maker\AbstractMaker::getClassName (
4
-        $objTables->getName ()
2
+<?php $classNameModel = $objTables->getNamespace() . '_' . \Classes\Maker\AbstractMaker::getClassName($objTables->getName()) ?>
3
+<?php $className = $objTables->getNamespace() . '_Entity_' . \Classes\Maker\AbstractMaker::getClassName(
4
+        $objTables->getName()
5 5
     ) ?>
6 6
 
7 7
 /**
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  *
10 10
  * <?= $this->config->last_modify . "\n" ?>
11 11
  *
12
- * @package <?= $objTables->getNamespace () . "\n" ?>
12
+ * @package <?= $objTables->getNamespace() . "\n" ?>
13 13
  * @subpackage Entity
14 14
  *
15 15
  * @author    <?= $this->config->author . "\n" ?>
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
                                                                         . "_" : "" ?>Model_<?= $objMakeFile->getFilesFixeds('parentClass')->getFileName() . "\n" ?>
29 29
 {
30 30
 
31
-<?php foreach ( $objTables->getColumns () as $column ): ?>
31
+<?php foreach ($objTables->getColumns() as $column): ?>
32 32
     /**
33
-     * Database constraint in the column <?= $column->getName () . "\n" ?>
33
+     * Database constraint in the column <?= $column->getName() . "\n" ?>
34 34
      *
35 35
      */
36
-    const <?= strtoupper ( $column->getName () ) ?> = '<?= $objTables->getName () ?>.<?= $column->getName () ?>';
36
+    const <?= strtoupper($column->getName()) ?> = '<?= $objTables->getName() ?>.<?= $column->getName() ?>';
37 37
 <?php endforeach; ?>
38 38
 
39 39
     /**
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
      * @var string
43 43
      * @access protected
44 44
      */
45
-    protected $_tableClass = '<?= $objTables->getNamespace () ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName (
46
-    $objTables->getName ()
45
+    protected $_tableClass = '<?= $objTables->getNamespace() ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName(
46
+    $objTables->getName()
47 47
 ) ?>';
48 48
 
49 49
     /**
50 50
      * @see <?= $this->config->namespace ?>Model_EntityAbstract::$_columnsList
51 51
      */
52 52
     protected $_columnsList = array(
53
-<?php foreach ( $objTables->getColumns () as $column ): ?>
54
-        self::<?= strtoupper ( $column->getName () ) ?> => '<?= strtolower (
55
-            \Classes\Maker\AbstractMaker::getClassName ( $column->getName () )
53
+<?php foreach ($objTables->getColumns() as $column): ?>
54
+        self::<?= strtoupper($column->getName()) ?> => '<?= strtolower(
55
+            \Classes\Maker\AbstractMaker::getClassName($column->getName())
56 56
     ) ?>',
57 57
 <?php endforeach; ?>
58 58
     );
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
      * @see <?= $this->config->namespace ?>Model_EntityAbstract::$_filters
62 62
      */
63 63
     protected $_filters = array(
64
-<?php foreach ( $objTables->getColumns () as $column ): ?>
64
+<?php foreach ($objTables->getColumns() as $column): ?>
65 65
 <?php
66 66
     $filters = null;
67
-    switch ( strtolower ( $column->getType () ) ) {
67
+    switch (strtolower($column->getType())) {
68 68
         case 'string':
69 69
             $filters = 'StripTags", "StringTrim';
70 70
             break;
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
         case 'datetime':
79 79
             break;
80 80
         case 'boolean':
81
-                $filters='Int';
81
+                $filters = 'Int';
82 82
             break;
83 83
         default:
84
-            $filters = ucfirst ( $column->getType () );
84
+            $filters = ucfirst($column->getType());
85 85
             break;
86 86
     }
87 87
     ?>
88
-    '<?= $column->getName () ?>' => array (
89
-            <?= ( !empty( $filters ) ) ? "\"{$filters}\"\n" : null; ?>
88
+    '<?= $column->getName() ?>' => array (
89
+            <?= ( ! empty($filters)) ? "\"{$filters}\"\n" : null; ?>
90 90
         ),
91 91
 <?php endforeach; ?>
92 92
     );
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
      * @see <?= $this->config->namespace ?>Model_EntityAbstract::$_validators
96 96
      */
97 97
     protected $_validators= array(
98
-<?php foreach ( $objTables->getColumns () as $column ): ?>
98
+<?php foreach ($objTables->getColumns() as $column): ?>
99 99
 <?php
100
-    $validators = array ();
100
+    $validators = array();
101 101
 
102
-    $validators[] = $column->isNullable () ? "'allowEmpty' => true" : "'NotEmpty'";
102
+    $validators[] = $column->isNullable() ? "'allowEmpty' => true" : "'NotEmpty'";
103 103
 
104
-    switch ( strtolower ( $column->getType () ) ) {
104
+    switch (strtolower($column->getType())) {
105 105
         case 'date':
106 106
             break;
107 107
         case 'timestamp':
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
         case 'datetime':
110 110
             break;
111 111
         case 'string':
112
-            if ( $column->getMaxLength () ) {
113
-                $validators[] = "array( 'StringLength', array( 'max' => " . $column->getMaxLength () . " ) )";
112
+            if ($column->getMaxLength()) {
113
+                $validators[] = "array( 'StringLength', array( 'max' => " . $column->getMaxLength() . " ) )";
114 114
             }
115 115
 
116 116
             break;
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
                 $validators[] = "'Int'";
119 119
             break;
120 120
         default:
121
-            $name         = ucfirst ( $column->getType () );
121
+            $name         = ucfirst($column->getType());
122 122
             $validators[] = "'$name'";
123 123
             break;
124 124
     }
125
-$validators = implode ( ", ", $validators ) ?>
126
-    '<?= $column->getName () ?>' => array (
127
-            <?= ( !empty( $validators ) ) ? "{$validators}\n" : null ?>
125
+$validators = implode(", ", $validators) ?>
126
+    '<?= $column->getName() ?>' => array (
127
+            <?= ( ! empty($validators)) ? "{$validators}\n" : null ?>
128 128
         ),
129 129
 <?php endforeach; ?>
130 130
     );
131 131
 
132
-<?php if ( $objTables->hasPrimaryKey () ): ?>
132
+<?php if ($objTables->hasPrimaryKey()): ?>
133 133
     /**
134 134
     * Nome da Primary Key
135 135
     *
@@ -137,171 +137,171 @@  discard block
 block discarded – undo
137 137
     * @access protected
138 138
     */
139 139
    protected $_primary = array(
140
-<?php foreach ( $objTables->getPrimarykeys () as $pks ) : ?>
141
-        '<?= $pks->getName () ?>',
140
+<?php foreach ($objTables->getPrimarykeys() as $pks) : ?>
141
+        '<?= $pks->getName() ?>',
142 142
 <?php endforeach ?>
143 143
     );
144 144
 <?php endif ?>
145 145
 
146
-<?php foreach ( $parents as $parent ): ?>
146
+<?php foreach ($parents as $parent): ?>
147 147
     /**
148
-     * Parent relation <?= \Classes\Maker\AbstractMaker::getClassName ( $parent[ 'table' ] ) . "\n" ?>
148
+     * Parent relation <?= \Classes\Maker\AbstractMaker::getClassName($parent['table']) . "\n" ?>
149 149
      *
150
-     * - CONSTRAINT in DB <?= $parent[ 'name' ] . "\n" ?>
150
+     * - CONSTRAINT in DB <?= $parent['name'] . "\n" ?>
151 151
      *
152
-     * @var <?= $parent[ 'variable' ] . "\n" ?>
152
+     * @var <?= $parent['variable'] . "\n" ?>
153 153
      */
154
-    protected $_parent_<?= $parent[ 'variable' ] ?>;
154
+    protected $_parent_<?= $parent['variable'] ?>;
155 155
 
156 156
 <?php endforeach; ?>
157
-<?php foreach ( $depends as $depend ): ?>
157
+<?php foreach ($depends as $depend): ?>
158 158
     /**
159
-     * Depends relation <?= \Classes\Maker\AbstractMaker::getClassName ( $depend[ 'table' ] ) . "\n" ?>
159
+     * Depends relation <?= \Classes\Maker\AbstractMaker::getClassName($depend['table']) . "\n" ?>
160 160
      *
161
-     * - CONSTRAINT in DB <?= $depend[ 'name' ] . "\n" ?>
161
+     * - CONSTRAINT in DB <?= $depend['name'] . "\n" ?>
162 162
      *
163
-     * @var <?= $depend[ 'variable' ] . "\n" ?>
163
+     * @var <?= $depend['variable'] . "\n" ?>
164 164
      */
165
-    protected $_depend_<?= $depend[ 'variable' ] ?>;
165
+    protected $_depend_<?= $depend['variable'] ?>;
166 166
 
167 167
 <?php endforeach; ?>
168
-<?php foreach ( $objTables->getColumns () as $column ): ?>
168
+<?php foreach ($objTables->getColumns() as $column): ?>
169 169
     /**
170 170
      *
171
-     * Sets column <?= $column->getName () . "\n" ?>
171
+     * Sets column <?= $column->getName() . "\n" ?>
172 172
      *
173
-<?php if ( $column->equalType ( 'date' ) ): ?>
173
+<?php if ($column->equalType('date')): ?>
174 174
      * Stored in ISO 8601 format.
175 175
      *
176
-     * @param string|Zend_Date $<?= $column->getName () . "\n" ?>
176
+     * @param string|Zend_Date $<?= $column->getName() . "\n" ?>
177 177
 <?php else: ?>
178
-     * @param <?= $column->getType () ?> $<?= $column->getName () . "\n" ?>
178
+     * @param <?= $column->getType() ?> $<?= $column->getName() . "\n" ?>
179 179
 <?php endif; ?>
180 180
      * @return <?= $className . "\n" ?>
181 181
      */
182
-    public function set<?= \Classes\Maker\AbstractMaker::getClassName ( $column->getName () ) ?>( $<?= $column->getName (
182
+    public function set<?= \Classes\Maker\AbstractMaker::getClassName($column->getName()) ?>( $<?= $column->getName(
183 183
     ) ?> )
184 184
     {
185
-<?php switch ( strtolower( $column->getType () ) ):
185
+<?php switch (strtolower($column->getType())):
186 186
         case 'timestamp':
187 187
         case 'date':
188 188
         case 'datetime':?>
189
-            if (! empty($<?= $column->getName () ?>))
189
+            if (! empty($<?= $column->getName() ?>))
190 190
             {
191
-                if (! $<?= $column->getName () ?> instanceof Zend_Date)
191
+                if (! $<?= $column->getName() ?> instanceof Zend_Date)
192 192
                 {
193
-                    $<?= $column->getName () ?> = new Zend_Date($<?= $column->getName () ?>);
193
+                    $<?= $column->getName() ?> = new Zend_Date($<?= $column->getName() ?>);
194 194
                 }
195
-<?php if( $column->equalType ( 'date' ) ): ?>
196
-                $<?= $column->getName () ?>->setOptions(array('format_type' => 'php'));
195
+<?php if ($column->equalType('date')): ?>
196
+                $<?= $column->getName() ?>->setOptions(array('format_type' => 'php'));
197 197
 <?php endif ?>
198
-<?php $format =  'Zend_Date::ISO_8601' ?>
199
-<?php if( $column->equalType ( 'date' ) ) { $format =  '\'Y-m-d\''; } ?>
200
-                $<?= $column->getName () ?> = $<?= $column->getName () ?>->toString( <?=$format?> );
198
+<?php $format = 'Zend_Date::ISO_8601' ?>
199
+<?php if ($column->equalType('date')) { $format = '\'Y-m-d\''; } ?>
200
+                $<?= $column->getName() ?> = $<?= $column->getName() ?>->toString( <?=$format?> );
201 201
             }
202
-<?php if($column->isNullable ()):?>
202
+<?php if ($column->isNullable()):?>
203 203
             else{
204
-                $<?= $column->getName () ?> = null;
204
+                $<?= $column->getName() ?> = null;
205 205
             }
206 206
 <?php endif ?>
207 207
 <?php break;
208 208
         case 'boolean':
209
-if(!$column->isNullable ()):?>
210
-            $<?= $column->getName () ?> = ( int ) $<?= $column->getName () ?> ;
209
+if ( ! $column->isNullable()):?>
210
+            $<?= $column->getName() ?> = ( int ) $<?= $column->getName() ?> ;
211 211
 <?php endif ?>
212 212
 <?php default: ?>
213
-<?php if(!$column->isNullable () && ($column->getType () != 'boolean')):?>
214
-            $<?= $column->getName () ?> = (<?= ucfirst ( $column->getType () ) ?>) $<?= $column->getName () ?> ;
213
+<?php if ( ! $column->isNullable() && ($column->getType() != 'boolean')):?>
214
+            $<?= $column->getName() ?> = (<?= ucfirst($column->getType()) ?>) $<?= $column->getName() ?> ;
215 215
 <?php endif ?>
216
-            $input = new Zend_Filter_Input($this->_filters, $this->_validators, array('<?= $column->getName () ?>'=>$<?= $column->getName () ?> ));
216
+            $input = new Zend_Filter_Input($this->_filters, $this->_validators, array('<?= $column->getName() ?>'=>$<?= $column->getName() ?> ));
217 217
 
218
-            if(!$input->isValid ('<?= $column->getName () ?>'))
218
+            if(!$input->isValid ('<?= $column->getName() ?>'))
219 219
             {
220 220
                 $errors =  $input->getMessages ();
221
-                foreach ( $errors['<?= $column->getName () ?>'] as $key => $value )
221
+                foreach ( $errors['<?= $column->getName() ?>'] as $key => $value )
222 222
                 {
223
-                    throw new <?= $this->config->namespace ? $this->config->namespace . "_" : "" ?>Model_EntityException ( '<?= $column->getName () ?> - ' . $value );
223
+                    throw new <?= $this->config->namespace ? $this->config->namespace . "_" : "" ?>Model_EntityException ( '<?= $column->getName() ?> - ' . $value );
224 224
                 }
225 225
             }
226 226
 <?php break ?>
227 227
 <?php endswitch ?>
228 228
 
229
-        $this-><?= $column->getName () ?>  = $<?= $column->getName () ?> ;
229
+        $this-><?= $column->getName() ?>  = $<?= $column->getName() ?> ;
230 230
         return $this;
231 231
     }
232 232
 
233 233
     /**
234
-     * Gets column <?= $column->getName () . "\n" ?>
234
+     * Gets column <?= $column->getName() . "\n" ?>
235 235
      *
236
-<?php if ( $column->equalType ( 'date' ) or $column->equalType ( 'datetime' ) or  $column->equalType ( 'timestamp' ) ): ?>
236
+<?php if ($column->equalType('date') or $column->equalType('datetime') or $column->equalType('timestamp')): ?>
237 237
      * @param boolean $returnZendDate
238 238
      * @return Zend_Date|null|string Zend_Date representation of this datetime if enabled, or ISO 8601 string if not
239 239
 <?php else: ?>
240
-     * @return <?= $column->getType () . "\n" ?>
240
+     * @return <?= $column->getType() . "\n" ?>
241 241
 <?php endif; ?>
242 242
      */
243
-    public function get<?= \Classes\Maker\AbstractMaker::getClassName (
244
-        $column->getName ()
245
-    ) ?>(<?php if ( $column->equalType ( 'date' ) or $column->equalType ( 'datetime' ) or  $column->equalType ( 'timestamp' ) ): ?>$format = false <?php endif; ?>)
243
+    public function get<?= \Classes\Maker\AbstractMaker::getClassName(
244
+        $column->getName()
245
+    ) ?>(<?php if ($column->equalType('date') or $column->equalType('datetime') or $column->equalType('timestamp')): ?>$format = false <?php endif; ?>)
246 246
     {
247
-<?php switch ( strtolower( $column->getType () ) ):
247
+<?php switch (strtolower($column->getType())):
248 248
         case 'timestamp':
249 249
         case 'date':
250 250
         case 'datetime':?>
251 251
         if ($format)
252 252
         {
253
-            if ($this->_data['<?= $column->getName () ?>'] === null)
253
+            if ($this->_data['<?= $column->getName() ?>'] === null)
254 254
             {
255 255
                 return null;
256 256
             }
257 257
 
258
-            $objDate = new Zend_Date($this-><?= $column->getName () ?>, $format );
258
+            $objDate = new Zend_Date($this-><?= $column->getName() ?>, $format );
259 259
 
260 260
             return $objDate->toString($format);
261 261
         }
262 262
 <?php break ?>
263 263
 <?php endswitch ?>
264
-     return $this-><?= $column->getName () ?>;
264
+     return $this-><?= $column->getName() ?>;
265 265
     }
266 266
 
267 267
 <?php endforeach; ?>
268
-<?php foreach ( $parents as $parent ): ?>
268
+<?php foreach ($parents as $parent): ?>
269 269
     /**
270
-     * Gets parent <?= $parent[ 'table' ] . "\n" ?>
270
+     * Gets parent <?= $parent['table'] . "\n" ?>
271 271
      *
272
-     * @return <?= $parent[ 'class' ] . "\n" ?>
272
+     * @return <?= $parent['class'] . "\n" ?>
273 273
      */
274
-    public function get<?= $parent[ 'function' ] ?>()
274
+    public function get<?= $parent['function'] ?>()
275 275
     {
276
-        if ($this->_parent_<?= $parent[ 'variable' ] ?> === null)
276
+        if ($this->_parent_<?= $parent['variable'] ?> === null)
277 277
         {
278
-            $this->_parent_<?= $parent[ 'variable' ] ?> = $this->findParentRow('<?= $objTables->getNamespace (
279
-    ) ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName (
280
-        $parent[ 'table' ]
281
-    ) ?>', '<?= \Classes\Maker\AbstractMaker::getClassName ( $parent[ 'variable' ] ) ?>');
278
+            $this->_parent_<?= $parent['variable'] ?> = $this->findParentRow('<?= $objTables->getNamespace(
279
+    ) ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName(
280
+        $parent['table']
281
+    ) ?>', '<?= \Classes\Maker\AbstractMaker::getClassName($parent['variable']) ?>');
282 282
         }
283 283
 
284
-        return $this->_parent_<?= $parent[ 'variable' ] ?>;
284
+        return $this->_parent_<?= $parent['variable'] ?>;
285 285
     }
286 286
 
287 287
 <?php endforeach; ?>
288 288
 
289 289
 
290
-<?php foreach ( $depends as $depend ): ?>
290
+<?php foreach ($depends as $depend): ?>
291 291
     /**
292
-     * Gets dependent <?= $depend[ 'table' ] . "\n" ?>
292
+     * Gets dependent <?= $depend['table'] . "\n" ?>
293 293
      *
294
-     * @return <?= $depend[ 'class' ] . "\n" ?>
294
+     * @return <?= $depend['class'] . "\n" ?>
295 295
      */
296
-    public function get<?= $depend[ 'function' ] ?>()
296
+    public function get<?= $depend['function'] ?>()
297 297
     {
298
-        if ($this->_depend_<?= $depend[ 'variable' ] ?> === null)
298
+        if ($this->_depend_<?= $depend['variable'] ?> === null)
299 299
         {
300
-            $this->_depend_<?= $depend[ 'variable' ] ?> = $this->findDependentRowset('<?= $objTables->getNamespace (
301
-    ) ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName ( $depend[ 'table' ] ) ?>');
300
+            $this->_depend_<?= $depend['variable'] ?> = $this->findDependentRowset('<?= $objTables->getNamespace(
301
+    ) ?>_DbTable_<?= \Classes\Maker\AbstractMaker::getClassName($depend['table']) ?>');
302 302
         }
303 303
 
304
-        return $this->_depend_<?= $depend[ 'variable' ] ?>;
304
+        return $this->_depend_<?= $depend['variable'] ?>;
305 305
     }
306 306
 
307 307
 <?php endforeach; ?>
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/AbstractAdapter.php 3 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     /**
137 137
      * @param \Classes\Db\DbTable|\Classes\Db\Constrant $table
138 138
      *
139
-     * @return mixed
139
+     * @return string
140 140
      */
141 141
 
142 142
     public function createClassNamespace ( $table )
@@ -225,6 +225,9 @@  discard block
 block discarded – undo
225 225
         return true;
226 226
     }
227 227
 
228
+    /**
229
+     * @return string
230
+     */
228 231
     protected function getFrameworkIni ()
229 232
     {
230 233
         return $this->framworkFiles[ 'ini' ];
@@ -332,7 +335,6 @@  discard block
 block discarded – undo
332 335
     }
333 336
 
334 337
     /**
335
-     * @param string $schema
336 338
      *
337 339
      * @return string
338 340
      */
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@
 block discarded – undo
400 400
         $matches = preg_grep ( '*\.*' , $this->getTablesName () );
401 401
         if ( count ( $matches ) )
402 402
         {
403
-           die("\033[0;31mError: Table name must not contain the schema.\033[0m\n");
403
+            die("\033[0;31mError: Table name must not contain the schema.\033[0m\n");
404 404
         }
405 405
     }
406 406
 
Please login to merge, or discard this patch.
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -16,90 +16,90 @@  discard block
 block discarded – undo
16 16
 abstract class AbstractAdapter
17 17
 {
18 18
 
19
-    protected $arrConfig = array (
19
+    protected $arrConfig = array(
20 20
         ############################# DATABASE
21 21
         //Driver do banco de dados
22
-        'driver'          => null ,
22
+        'driver'          => null,
23 23
         //Nome do banco de dados
24
-        'database'        => null ,
24
+        'database'        => null,
25 25
         //Host do banco
26
-        'host'            => 'localhost' ,
26
+        'host'            => 'localhost',
27 27
         //Port do banco
28
-        'port'            => '' ,
28
+        'port'            => '',
29 29
         //usuario do banco
30
-        'username'        => null ,
30
+        'username'        => null,
31 31
         //senha do banco
32
-        'password'        => null ,
32
+        'password'        => null,
33 33
         // lista de schemas do banco de dados
34
-        'schema'          => array () ,
35
-        'version'         => '' ,
36
-        'socket'          => null ,
34
+        'schema'          => array(),
35
+        'version'         => '',
36
+        'socket'          => null,
37 37
 
38 38
         ########################### DOCS
39 39
         // autor que gerou o script
40
-        'author'          => "Pedro" ,
41
-        'license'         => "New BSD License" ,
42
-        'copyright'       => "ORM Generator - Pedro151" ,
43
-        'link'            => 'https://github.com/pedro151/orm-generator' ,
44
-        'version'         => '' ,
40
+        'author'          => "Pedro",
41
+        'license'         => "New BSD License",
42
+        'copyright'       => "ORM Generator - Pedro151",
43
+        'link'            => 'https://github.com/pedro151/orm-generator',
44
+        'version'         => '',
45 45
         // data que foi gerado o script
46
-        'last_modify'     => null ,
46
+        'last_modify'     => null,
47 47
 
48 48
         ########################## Ambiente/Arquivos
49 49
 
50 50
         // Nome do framework para o adapter
51
-        'framework'       => null ,
51
+        'framework'       => null,
52 52
         // namespace das classes
53
-        'namespace'       => "" ,
53
+        'namespace'       => "",
54 54
         // caminho onde os arquivos devem ser criados
55
-        'path'            => 'models' ,
55
+        'path'            => 'models',
56 56
         // flag para gerar pasta com o nome do driver do banco de dados
57
-        'folder-database' => 0 ,
57
+        'folder-database' => 0,
58 58
         // string com o nome da pastar personalizada
59
-        'folder-name'     => '' ,
59
+        'folder-name'     => '',
60 60
 
61 61
         'clean-trash'     => false,
62 62
 
63 63
         ############################## Comandos adicionais
64 64
         //flag para mostrar o status da execução ao termino do processo
65
-        'status'          => false ,
65
+        'status'          => false,
66 66
         // flags para criar todas as tabelas ou nao
67
-        'tables'          => array () ,
67
+        'tables'          => array(),
68 68
         // lista de Classes opcionais pre-definidas para serem criadas
69
-        'optional-classes'=> array (),
69
+        'optional-classes'=> array(),
70 70
         //Lista de tabelas a serem ignoradas
71
-        'ignoreTable'     => array () ,
71
+        'ignoreTable'     => array(),
72 72
     );
73 73
 
74 74
     /**
75 75
      * @var string[] um array com todos os campos obrigatorios
76 76
      */
77
-    protected $attRequered = array (
78
-        'driver'   => true ,
79
-        'database' => true ,
80
-        'host'     => true ,
81
-        'username' => true ,
77
+    protected $attRequered = array(
78
+        'driver'   => true,
79
+        'database' => true,
80
+        'host'     => true,
81
+        'username' => true,
82 82
         'path'     => true
83 83
     );
84 84
 
85
-    protected $arrFunc = array ();
85
+    protected $arrFunc = array();
86 86
 
87
-    private $framworkFiles = array ();
87
+    private $framworkFiles = array();
88 88
 
89
-    public $reservedWord = array ();
89
+    public $reservedWord = array();
90 90
 
91
-    private static $dataTypesDefault = array (
92
-        'int'       => 'int' ,
93
-        'float'     => 'float' ,
94
-        'string'    => 'string' ,
95
-        'text'      => 'string' ,
96
-        'date'      => 'date' ,
97
-        'datetime'  => 'datetime' ,
98
-        'timestamp' => 'timestamp' ,
91
+    private static $dataTypesDefault = array(
92
+        'int'       => 'int',
93
+        'float'     => 'float',
94
+        'string'    => 'string',
95
+        'text'      => 'string',
96
+        'date'      => 'date',
97
+        'datetime'  => 'datetime',
98
+        'timestamp' => 'timestamp',
99 99
         'boolean'   => 'boolean'
100 100
     );
101 101
 
102
-    protected $dataTypes = array ();
102
+    protected $dataTypes = array();
103 103
 
104 104
     const SEPARETOR = "";
105 105
 
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @return bool
110 110
      */
111
-    protected function checkConfig ()
111
+    protected function checkConfig()
112 112
     {
113
-        if ( array_diff_key ( $this->attRequered , array_filter ( $this->arrConfig ) ) )
113
+        if (array_diff_key($this->attRequered, array_filter($this->arrConfig)))
114 114
         {
115 115
             return false;
116 116
         }
@@ -123,33 +123,33 @@  discard block
 block discarded – undo
123 123
      *
124 124
      * @return array
125 125
      */
126
-    abstract protected function getParams ();
126
+    abstract protected function getParams();
127 127
 
128 128
     /**
129 129
      * Popula as config do generater com as configuraçoes do framework
130 130
      *
131 131
      * @return mixed
132 132
      */
133
-    abstract protected function parseFrameworkConfig ();
133
+    abstract protected function parseFrameworkConfig();
134 134
 
135 135
     /**
136 136
      * Cria Instancias dos arquivos que devem ser gerados
137 137
      *
138 138
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
139 139
      */
140
-    abstract public function getMakeFileInstances ();
140
+    abstract public function getMakeFileInstances();
141 141
 
142
-    abstract protected function init ();
142
+    abstract protected function init();
143 143
 
144 144
     /**
145 145
      * retorna a base do Namespace
146 146
      *
147 147
      * @return array
148 148
      */
149
-    protected function getBaseNamespace ()
149
+    protected function getBaseNamespace()
150 150
     {
151
-        return array (
152
-            $this->arrConfig[ 'namespace' ] ,
151
+        return array(
152
+            $this->arrConfig['namespace'],
153 153
             'Model'
154 154
         );
155 155
     }
@@ -160,54 +160,54 @@  discard block
 block discarded – undo
160 160
      * @return mixed
161 161
      */
162 162
 
163
-    public function createClassNamespace ( $table )
163
+    public function createClassNamespace($table)
164 164
     {
165
-        $arrNames = $this->getBaseNamespace ();
165
+        $arrNames = $this->getBaseNamespace();
166 166
 
167
-        if ( isset( $this->arrConfig[ 'folder-database' ] )
168
-             && $this->arrConfig[ 'folder-database' ]
167
+        if (isset($this->arrConfig['folder-database'])
168
+             && $this->arrConfig['folder-database']
169 169
         )
170 170
         {
171
-            $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig[ 'driver' ] );
171
+            $arrNames[] = AbstractMaker::getClassName($this->arrConfig['driver']);
172 172
         }
173 173
 
174
-        if ( isset( $this->arrConfig[ 'folder-name' ] )
175
-             && $this->arrConfig[ 'folder-name' ]
174
+        if (isset($this->arrConfig['folder-name'])
175
+             && $this->arrConfig['folder-name']
176 176
         )
177 177
         {
178
-            $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig[ 'folder-name' ] );
178
+            $arrNames[] = AbstractMaker::getClassName($this->arrConfig['folder-name']);
179 179
         }
180 180
 
181
-        if ( $table->hasSchema () )
181
+        if ($table->hasSchema())
182 182
         {
183
-            $arrNames[] = $this->replaceReservedWord ( AbstractMaker::getClassName ( $table->getSchema () ) );
183
+            $arrNames[] = $this->replaceReservedWord(AbstractMaker::getClassName($table->getSchema()));
184 184
         } else
185 185
         {
186
-            $arrNames[] = $this->replaceReservedWord ( AbstractMaker::getClassName ( $table->getDatabase () ) );
186
+            $arrNames[] = $this->replaceReservedWord(AbstractMaker::getClassName($table->getDatabase()));
187 187
         }
188 188
 
189
-        return implode ( static::SEPARETOR , array_filter ( $arrNames ) );
189
+        return implode(static::SEPARETOR, array_filter($arrNames));
190 190
     }
191 191
 
192
-    public function __construct ( $array )
192
+    public function __construct($array)
193 193
     {
194 194
         $this->dataTypes = $this->dataTypes + self::$dataTypesDefault;
195
-        $array += array (
196
-            'version'     => Config::$version ,
197
-            'author'      => ucfirst ( get_current_user () ) ,
198
-            'last_modify' => date ( "d-m-Y" )
195
+        $array += array(
196
+            'version'     => Config::$version,
197
+            'author'      => ucfirst(get_current_user()),
198
+            'last_modify' => date("d-m-Y")
199 199
         );
200 200
 
201
-        $this->setFrameworkFiles ( $array );
202
-        $this->parseFrameworkConfig ();
203
-        $this->setParams ( $this->getParams () );
204
-        $this->setParams ( $array );
205
-        $this->init ();
206
-        $this->validTableNames ();
207
-        if ( ! $this->isValid () )
201
+        $this->setFrameworkFiles($array);
202
+        $this->parseFrameworkConfig();
203
+        $this->setParams($this->getParams());
204
+        $this->setParams($array);
205
+        $this->init();
206
+        $this->validTableNames();
207
+        if ( ! $this->isValid())
208 208
         {
209
-            $var = array_diff_key ( $this->attRequered , array_filter ( $this->arrConfig ) );
210
-            throw new Exception( $var );
209
+            $var = array_diff_key($this->attRequered, array_filter($this->arrConfig));
210
+            throw new Exception($var);
211 211
         }
212 212
     }
213 213
 
@@ -216,43 +216,43 @@  discard block
 block discarded – undo
216 216
      *
217 217
      * @param $array
218 218
      */
219
-    public function setFrameworkFiles ( $array )
219
+    public function setFrameworkFiles($array)
220 220
     {
221
-        $this->framworkFiles[ 'library' ] = isset( $array[ 'framework-path-library' ] )
222
-            ? $array[ 'framework-path-library' ] : null;
221
+        $this->framworkFiles['library'] = isset($array['framework-path-library'])
222
+            ? $array['framework-path-library'] : null;
223 223
 
224
-        $this->framworkFiles[ 'ini' ] = isset( $array[ 'framework-ini' ] )
225
-            ? $array[ 'framework-ini' ] : null;
224
+        $this->framworkFiles['ini'] = isset($array['framework-ini'])
225
+            ? $array['framework-ini'] : null;
226 226
 
227
-        $this->framworkFiles[ 'environment' ] = isset( $array[ 'environment' ] )
228
-            ? $array[ 'environment' ] : 'production';
227
+        $this->framworkFiles['environment'] = isset($array['environment'])
228
+            ? $array['environment'] : 'production';
229 229
 
230 230
     }
231 231
 
232
-    protected function isValidFrameworkFiles ()
232
+    protected function isValidFrameworkFiles()
233 233
     {
234
-        if ( ! is_file ( $this->framworkFiles[ 'ini' ] ) )
234
+        if ( ! is_file($this->framworkFiles['ini']))
235 235
         {
236 236
             return false;
237 237
         }
238 238
 
239
-        if ( ! is_dir ( $this->framworkFiles[ 'library' ] ) )
239
+        if ( ! is_dir($this->framworkFiles['library']))
240 240
         {
241 241
             return false;
242 242
         }
243 243
 
244
-        if ( ! isset ( $this->framworkFiles[ 'environment' ] )
245
-             or empty( $this->framworkFiles[ 'environment' ] )
244
+        if ( ! isset ($this->framworkFiles['environment'])
245
+             or empty($this->framworkFiles['environment'])
246 246
         )
247 247
         {
248 248
             return false;
249 249
         }
250
-        set_include_path (
251
-            implode (
252
-                PATH_SEPARATOR ,
253
-                array (
254
-                    realpath ( $this->framworkFiles[ 'library' ] ) ,
255
-                    get_include_path () ,
250
+        set_include_path(
251
+            implode(
252
+                PATH_SEPARATOR,
253
+                array(
254
+                    realpath($this->framworkFiles['library']),
255
+                    get_include_path(),
256 256
                 )
257 257
             )
258 258
         );
@@ -260,119 +260,119 @@  discard block
 block discarded – undo
260 260
         return true;
261 261
     }
262 262
 
263
-    protected function getFrameworkIni ()
263
+    protected function getFrameworkIni()
264 264
     {
265
-        return $this->framworkFiles[ 'ini' ];
265
+        return $this->framworkFiles['ini'];
266 266
     }
267 267
 
268
-    protected function getEnvironment ()
268
+    protected function getEnvironment()
269 269
     {
270
-        return $this->framworkFiles[ 'environment' ];
270
+        return $this->framworkFiles['environment'];
271 271
     }
272 272
 
273 273
     /**
274 274
      * Popula as variaveis de acordo com o arquivo de configuração do seu  framework
275 275
      */
276
-    protected function isValid ()
276
+    protected function isValid()
277 277
     {
278
-        return $this->checkConfig ();
278
+        return $this->checkConfig();
279 279
     }
280 280
 
281
-    private function setParams ( $array )
281
+    private function setParams($array)
282 282
     {
283
-        if ( count ( $array ) > 0 )
283
+        if (count($array) > 0)
284 284
         {
285
-            $this->arrConfig = array_filter ( $array ) + $this->arrConfig;
285
+            $this->arrConfig = array_filter($array) + $this->arrConfig;
286 286
         }
287 287
     }
288 288
 
289 289
     /**
290 290
      * @return string
291 291
      */
292
-    public function getDatabase ()
292
+    public function getDatabase()
293 293
     {
294
-        return $this->arrConfig[ 'database' ];
294
+        return $this->arrConfig['database'];
295 295
     }
296 296
 
297 297
     /**
298 298
      * @return bool
299 299
      */
300
-    public function hasSchemas ()
300
+    public function hasSchemas()
301 301
     {
302
-        return ! empty ( $this->arrConfig[ 'schema' ] );
302
+        return ! empty ($this->arrConfig['schema']);
303 303
     }
304 304
 
305 305
     /**
306 306
      * @return string[]
307 307
      */
308
-    public function getSchemas ()
308
+    public function getSchemas()
309 309
     {
310
-        if ( is_string ( $this->arrConfig[ 'schema' ] ) )
310
+        if (is_string($this->arrConfig['schema']))
311 311
         {
312
-            return array ( $this->arrConfig[ 'schema' ] );
312
+            return array($this->arrConfig['schema']);
313 313
         }
314 314
 
315
-        return $this->arrConfig[ 'schema' ];
315
+        return $this->arrConfig['schema'];
316 316
     }
317 317
 
318
-    public function setSchema ( $schema )
318
+    public function setSchema($schema)
319 319
     {
320
-        $this->arrConfig[ 'schema' ] = $schema;
320
+        $this->arrConfig['schema'] = $schema;
321 321
     }
322 322
 
323 323
     /**
324 324
      * @return string
325 325
      */
326
-    public function getHost ()
326
+    public function getHost()
327 327
     {
328
-        return $this->arrConfig[ 'host' ];
328
+        return $this->arrConfig['host'];
329 329
     }
330 330
 
331 331
     /**
332 332
      * @return int
333 333
      */
334
-    public function getPort ()
334
+    public function getPort()
335 335
     {
336
-        return $this->arrConfig[ 'port' ];
336
+        return $this->arrConfig['port'];
337 337
     }
338 338
 
339 339
     /**
340 340
      * @return boolean
341 341
      */
342
-    public function hasPort ()
342
+    public function hasPort()
343 343
     {
344
-        return ! empty( $this->arrConfig[ 'port' ] );
344
+        return ! empty($this->arrConfig['port']);
345 345
     }
346 346
 
347 347
     /**
348 348
      * @return boolean
349 349
      */
350
-    public function isCleanTrash(){
351
-        return (boolean) $this->arrConfig[ 'clean-trash' ];
350
+    public function isCleanTrash() {
351
+        return (boolean) $this->arrConfig['clean-trash'];
352 352
     }
353 353
 
354 354
     /**
355 355
      * @return string
356 356
      */
357
-    public function getSocket ()
357
+    public function getSocket()
358 358
     {
359
-        return $this->arrConfig[ 'socket' ];
359
+        return $this->arrConfig['socket'];
360 360
     }
361 361
 
362 362
     /**
363 363
      * @return string
364 364
      */
365
-    public function getUser ()
365
+    public function getUser()
366 366
     {
367
-        return $this->arrConfig[ 'username' ];
367
+        return $this->arrConfig['username'];
368 368
     }
369 369
 
370 370
     /**
371 371
      * @return string
372 372
      */
373
-    public function getPassword ()
373
+    public function getPassword()
374 374
     {
375
-        return $this->arrConfig[ 'password' ];
375
+        return $this->arrConfig['password'];
376 376
     }
377 377
 
378 378
     /**
@@ -380,11 +380,11 @@  discard block
 block discarded – undo
380 380
      *
381 381
      * @return string
382 382
      */
383
-    public function replaceReservedWord ( $palavra )
383
+    public function replaceReservedWord($palavra)
384 384
     {
385
-        if ( isset( $this->reservedWord[ strtolower ( $palavra ) ] ) )
385
+        if (isset($this->reservedWord[strtolower($palavra)]))
386 386
         {
387
-            return $this->reservedWord[ strtolower ( $palavra ) ];
387
+            return $this->reservedWord[strtolower($palavra)];
388 388
         }
389 389
 
390 390
         return $palavra;
@@ -393,15 +393,15 @@  discard block
 block discarded – undo
393 393
     /**
394 394
      * @return bool
395 395
      */
396
-    public function isStatusEnabled ()
396
+    public function isStatusEnabled()
397 397
     {
398
-        return (bool) $this->arrConfig[ 'status' ];
398
+        return (bool) $this->arrConfig['status'];
399 399
     }
400 400
 
401
-    public function validTableNames ()
401
+    public function validTableNames()
402 402
     {
403
-        $matches = preg_grep ( '*\.*' , $this->getTablesName () );
404
-        if ( count ( $matches ) )
403
+        $matches = preg_grep('*\.*', $this->getTablesName());
404
+        if (count($matches))
405 405
         {
406 406
            die("\033[0;31mError: Table name must not contain the schema.\033[0m\n");
407 407
         }
@@ -410,49 +410,49 @@  discard block
 block discarded – undo
410 410
     /**
411 411
      * @return bool
412 412
      */
413
-    public function hasTablesName (){
414
-        return ! empty( $this->arrConfig[ 'tables' ] );
413
+    public function hasTablesName() {
414
+        return ! empty($this->arrConfig['tables']);
415 415
     }
416 416
 
417 417
     /**
418 418
      * @return string[]
419 419
      */
420
-    public function getTablesName ()
420
+    public function getTablesName()
421 421
     {
422
-        if ( is_string ( $this->arrConfig[ 'tables' ] ) )
422
+        if (is_string($this->arrConfig['tables']))
423 423
         {
424
-            return array ( $this->arrConfig[ 'tables' ] );
424
+            return array($this->arrConfig['tables']);
425 425
         }
426 426
 
427
-        return $this->arrConfig[ 'tables' ];
427
+        return $this->arrConfig['tables'];
428 428
     }
429 429
 
430 430
     /**
431 431
      * @return string
432 432
      */
433
-    public function getListTablesName(){
434
-        $str = implode("','", $this->getTablesName() );
433
+    public function getListTablesName() {
434
+        $str = implode("','", $this->getTablesName());
435 435
         return "'$str'";
436 436
     }
437 437
 
438 438
     /**
439 439
      * @return bool
440 440
      */
441
-    public function hasOptionalClasses (){
442
-        return ! empty( $this->arrConfig[ 'optional-classes' ] );
441
+    public function hasOptionalClasses() {
442
+        return ! empty($this->arrConfig['optional-classes']);
443 443
     }
444 444
 
445 445
     /**
446 446
      * @return string[]
447 447
      */
448
-    public function getOptionalClasses ()
448
+    public function getOptionalClasses()
449 449
     {
450
-        if ( is_string ( $this->arrConfig[ 'optional-classes' ] ) )
450
+        if (is_string($this->arrConfig['optional-classes']))
451 451
         {
452
-            return array ( $this->arrConfig[ 'optional-classes' ] );
452
+            return array($this->arrConfig['optional-classes']);
453 453
         }
454 454
 
455
-        return $this->arrConfig[ 'optional-classes' ];
455
+        return $this->arrConfig['optional-classes'];
456 456
     }
457 457
 
458 458
     /**
@@ -460,25 +460,25 @@  discard block
 block discarded – undo
460 460
      *
461 461
      * @return string
462 462
      */
463
-    public function __get ( $str )
463
+    public function __get($str)
464 464
     {
465
-        $arr = array (
466
-            'namespace' ,
467
-            'framework' ,
468
-            'author' ,
469
-            'license' ,
470
-            'version' ,
471
-            'copyright' ,
472
-            'link' ,
473
-            'last_modify' ,
474
-            'path' ,
475
-            'folder-database' ,
465
+        $arr = array(
466
+            'namespace',
467
+            'framework',
468
+            'author',
469
+            'license',
470
+            'version',
471
+            'copyright',
472
+            'link',
473
+            'last_modify',
474
+            'path',
475
+            'folder-database',
476 476
             'folder-name'
477 477
         );
478 478
 
479
-        if ( in_array ( $str , $arr ) )
479
+        if (in_array($str, $arr))
480 480
         {
481
-            return $this->arrConfig[ strtolower ( $str ) ];
481
+            return $this->arrConfig[strtolower($str)];
482 482
         }
483 483
 
484 484
         return;
@@ -489,9 +489,9 @@  discard block
 block discarded – undo
489 489
      *
490 490
      * @return string
491 491
      */
492
-    public static function convertTypeToPHP ( $type )
492
+    public static function convertTypeToPHP($type)
493 493
     {
494
-        return self::$dataTypesDefault[ $type ];
494
+        return self::$dataTypesDefault[$type];
495 495
     }
496 496
 
497 497
     /**
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
      *
500 500
      * @return string
501 501
      */
502
-    public function convertTypeToTypeFramework ( $type )
502
+    public function convertTypeToTypeFramework($type)
503 503
     {
504
-        return $this->dataTypes[ $type ];
504
+        return $this->dataTypes[$type];
505 505
     }
506 506
 }
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/Phalcon/Entity.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 '$this->belongsTo(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
55 55
                 $objColumn->getName (),
56 56
                 $makerFile->getConfig ()
57
-                          ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
57
+                            ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
58 58
                     $constrant->getTable ()
59 59
                 ),
60 60
                 $constrant->getColumn (),
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     '$this->hasMany(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
87 87
                     $objColumn->getName (),
88 88
                     $makerFile->getConfig ()
89
-                              ->createClassNamespace ( $dependence )
89
+                                ->createClassNamespace ( $dependence )
90 90
                     . Phalcon::SEPARETOR
91 91
                     . AbstractMaker::getClassName ( $dependence->getTable () ),
92 92
                     $dependence->getColumn (),
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 
16 16
     public    $pastName      = 'Entity';
17 17
     protected $fileTpl       = "entity.php";
18
-    protected $fileFixedData = array (
19
-        'parentclass' => array (
20
-            'name' => "AbstractEntity" ,
18
+    protected $fileFixedData = array(
19
+        'parentclass' => array(
20
+            'name' => "AbstractEntity",
21 21
             'tpl'  => "entity_abstract.php"
22 22
         )
23 23
     );
24 24
 
25
-    protected $overwrite     = true;
25
+    protected $overwrite = true;
26 26
 
27
-    protected $validFunc = array ();
27
+    protected $validFunc = array();
28 28
 
29 29
     private $intersectDependence = false;
30 30
 
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return array
36 36
      */
37
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
37
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
38 38
     {
39
-        return array (
40
-            'mapParents'    => $this->listParents ( $makerFile, $dbTable ),
41
-            'mapDependents' => $this->listDependence ( $makerFile, $dbTable )
39
+        return array(
40
+            'mapParents'    => $this->listParents($makerFile, $dbTable),
41
+            'mapDependents' => $this->listDependence($makerFile, $dbTable)
42 42
         );
43 43
     }
44 44
 
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return array
50 50
      */
51
-    private function listParents ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
51
+    private function listParents(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
52 52
     {
53 53
         $mapParents = '';
54
-        $references = array ();
55
-        foreach ( $dbTable->getForeingkeys () as $objColumn ) {
56
-            $constrant    = $objColumn->getFks ();
57
-            $references[] = sprintf (
54
+        $references = array();
55
+        foreach ($dbTable->getForeingkeys() as $objColumn) {
56
+            $constrant    = $objColumn->getFks();
57
+            $references[] = sprintf(
58 58
                 '$this->belongsTo(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
59
-                $objColumn->getName (),
60
-                $makerFile->getConfig ()
61
-                          ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
62
-                    $constrant->getTable ()
59
+                $objColumn->getName(),
60
+                $makerFile->getConfig()
61
+                          ->createClassNamespace($constrant) . Phalcon::SEPARETOR . AbstractMaker::getClassName(
62
+                    $constrant->getTable()
63 63
                 ),
64
-                $constrant->getColumn (),
65
-                AbstractMaker::getClassName ( $constrant->getTable () )
64
+                $constrant->getColumn(),
65
+                AbstractMaker::getClassName($constrant->getTable())
66 66
             );
67 67
         }
68 68
 
69
-        if ( sizeof ( $references ) > 0 ) {
70
-            $mapParents = join ( ";\n\t\t", $references ) . ";\n";
69
+        if (sizeof($references) > 0) {
70
+            $mapParents = join(";\n\t\t", $references) . ";\n";
71 71
         }
72 72
 
73 73
 
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return array
82 82
      */
83
-    private function listDependence ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
83
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
84 84
     {
85 85
         $mapDependence = '';
86
-        $references    = array ();
87
-        foreach ( $dbTable->getDependences () as $objColumn ) {
88
-            foreach ( $objColumn->getDependences () as $dependence ) {
89
-                $references[] = sprintf (
86
+        $references    = array();
87
+        foreach ($dbTable->getDependences() as $objColumn) {
88
+            foreach ($objColumn->getDependences() as $dependence) {
89
+                $references[] = sprintf(
90 90
                     '$this->hasMany(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
91
-                    $objColumn->getName (),
92
-                    $makerFile->getConfig ()
93
-                              ->createClassNamespace ( $dependence )
91
+                    $objColumn->getName(),
92
+                    $makerFile->getConfig()
93
+                              ->createClassNamespace($dependence)
94 94
                     . Phalcon::SEPARETOR
95
-                    . AbstractMaker::getClassName ( $dependence->getTable () ),
96
-                    $dependence->getColumn (),
97
-                    AbstractMaker::getClassName ( $dependence->getTable () )
95
+                    . AbstractMaker::getClassName($dependence->getTable()),
96
+                    $dependence->getColumn(),
97
+                    AbstractMaker::getClassName($dependence->getTable())
98 98
                 );
99 99
 
100 100
             }
101 101
         }
102 102
 
103
-        if ( sizeof ( $references ) > 0 ) {
104
-            $mapDependence = join ( ";\n\t\t", $references ) . ";";
103
+        if (sizeof($references) > 0) {
104
+            $mapDependence = join(";\n\t\t", $references) . ";";
105 105
         }
106 106
 
107 107
         return $mapDependence;
Please login to merge, or discard this patch.
build/Classes/templates/phalcon/model.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 block discarded – undo
3 3
 /**
4 4
  * Data Model implementation for this class
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8
- * @see  <?=$objTables->getNamespace()?>\<?=$this->getClassName ( $objTables->getName () ). "\n"?>
8
+ * @see  <?=$objTables->getNamespace()?>\<?=$this->getClassName($objTables->getName()) . "\n"?>
9 9
  *
10
- * @author    <?=$this->config->author."\n"?>
10
+ * @author    <?=$this->config->author . "\n"?>
11 11
  *
12
- * @copyright <?=$this->config->copyright."\n"?>
13
- * @license   <?=$this->config->license."\n"?>
14
- * @link      <?=$this->config->link."\n"?>
15
- * @version   <?=$this->config->version."\n"?>
12
+ * @copyright <?=$this->config->copyright . "\n"?>
13
+ * @license   <?=$this->config->license . "\n"?>
14
+ * @link      <?=$this->config->link . "\n"?>
15
+ * @version   <?=$this->config->version . "\n"?>
16 16
  */
17 17
 
18 18
 
19 19
 namespace <?=$objTables->getNamespace()?>;
20 20
 
21
-class <?=$this->getClassName ( $objTables->getName () )?> extends \<?=$objTables->getNamespace()?>\Entity\<?=$this->getClassName ( $objTables->getName () ). "\n"?>
21
+class <?=$this->getClassName($objTables->getName())?> extends \<?=$objTables->getNamespace()?>\Entity\<?=$this->getClassName($objTables->getName()) . "\n"?>
22 22
 {
23 23
        /* @TODO Codifique aqui */
24 24
 }
Please login to merge, or discard this patch.
build/Classes/templates/phalcon/peer_abstract.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,19 +3,19 @@
 block discarded – undo
3 3
 /**
4 4
  * Mvc Model
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8 8
  * @package   <?=$this->config->namespace?>\Models
9 9
  * @subpackage Model
10
- * @author    <?=$this->config->author."\n"?>
10
+ * @author    <?=$this->config->author . "\n"?>
11 11
  *
12
- * @copyright <?=$this->config->copyright."\n"?>
13
- * @license   <?=$this->config->license."\n"?>
14
- * @link      <?=$this->config->link."\n"?>
15
- * @version   <?=$this->config->version."\n"?>
12
+ * @copyright <?=$this->config->copyright . "\n"?>
13
+ * @license   <?=$this->config->license . "\n"?>
14
+ * @link      <?=$this->config->link . "\n"?>
15
+ * @version   <?=$this->config->version . "\n"?>
16 16
  */
17 17
 
18
-namespace  <?=$this->config->namespace?$this->config->namespace."\\":""?>Models;
18
+namespace  <?=$this->config->namespace ? $this->config->namespace . "\\" : ""?>Models;
19 19
 
20 20
 abstract class AbstractPeer
21 21
 {
Please login to merge, or discard this patch.
build/Classes/templates/zf1/dbtable_abstract.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * Application Model DbTables
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8 8
  * Classe Abstract pai de todas as tabelas
9 9
  *
10 10
  * @package   <?=$this->config->namespace?>Model
11 11
  * @subpackage DbTable
12
- * @author    <?=$this->config->author."\n"?>
12
+ * @author    <?=$this->config->author . "\n"?>
13 13
  *
14
- * @copyright <?=$this->config->copyright."\n"?>
15
- * @license   <?=$this->config->license."\n"?>
16
- * @link      <?=$this->config->link."\n"?>
17
- * @version   <?=$this->config->version."\n"?>
14
+ * @copyright <?=$this->config->copyright . "\n"?>
15
+ * @license   <?=$this->config->license . "\n"?>
16
+ * @link      <?=$this->config->link . "\n"?>
17
+ * @version   <?=$this->config->version . "\n"?>
18 18
  *
19 19
  * @abstract
20 20
  */
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * Zend DB Table Abstract class
24 24
  */
25 25
 
26
-abstract class <?=$this->config->namespace?$this->config->namespace."_":""?>Model_TableAbstract extends Zend_Db_Table_Abstract
26
+abstract class <?=$this->config->namespace ? $this->config->namespace . "_" : ""?>Model_TableAbstract extends Zend_Db_Table_Abstract
27 27
 {
28 28
     /**
29 29
      * Nome da tabela do banco de dados
Please login to merge, or discard this patch.
build/Classes/AdaptersDriver/AbsractAdapter.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     /**
201 201
      * Retorna o Nome da Sequence da tabela
202 202
      *
203
-     * @param $table
203
+     * @param string $table
204 204
      * @param $column
205 205
      *
206 206
      * @return string
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      * @param     $nameTable
250 250
      * @param int $schema
251 251
      *
252
-     * @return \Classes\Db\DbTable
252
+     * @return AbsractAdapter
253 253
      */
254 254
     public function createTable ( $nameTable, $schema = 0 )
255 255
     {
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     /**
305 305
      * @param string     $nameTable
306
-     * @param int|string $schema
306
+     * @param integer $schema
307 307
      *
308 308
      * @return bool
309 309
      */
Please login to merge, or discard this patch.
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -115,32 +115,32 @@  discard block
 block discarded – undo
115 115
             if ( $table->hasColumn ( $constrant[ "column_name" ] ) )
116 116
             {
117 117
                 $objConstrant = Constrant::getInstance ()
118
-                                         ->populate (
119
-                                             array (
120
-                                                 'constrant' => $constrant[ 'constraint_name' ] ,
121
-                                                 'schema'    => $constrant[ 'foreign_schema' ] ,
122
-                                                 'table'     => $constrant[ 'foreign_table' ] ,
123
-                                                 'column'    => $constrant[ 'foreign_column' ] ,
124
-                                                 'database'  => $this->database
125
-                                             )
126
-                                         );
118
+                                            ->populate (
119
+                                                array (
120
+                                                    'constrant' => $constrant[ 'constraint_name' ] ,
121
+                                                    'schema'    => $constrant[ 'foreign_schema' ] ,
122
+                                                    'table'     => $constrant[ 'foreign_table' ] ,
123
+                                                    'column'    => $constrant[ 'foreign_column' ] ,
124
+                                                    'database'  => $this->database
125
+                                                )
126
+                                            );
127 127
 
128 128
                 switch ( $constrant[ 'constraint_type' ] )
129 129
                 {
130 130
                     case "FOREIGN KEY":
131 131
                         $table->getColumn ( $constrant[ "column_name" ] )
132
-                              ->addRefFk ( $objConstrant );
132
+                                ->addRefFk ( $objConstrant );
133 133
                         break;
134 134
                     case"PRIMARY KEY":
135 135
                         $table->getColumn ( $constrant[ "column_name" ] )
136
-                              ->setPrimaryKey ( $objConstrant )
137
-                              ->setSequence (
138
-                                  $this->getSequence (
139
-                                      $table_name ,
140
-                                      $constrant[ "column_name" ] ,
141
-                                      $schema
142
-                                  )
143
-                              );
136
+                                ->setPrimaryKey ( $objConstrant )
137
+                                ->setSequence (
138
+                                    $this->getSequence (
139
+                                        $table_name ,
140
+                                        $constrant[ "column_name" ] ,
141
+                                        $schema
142
+                                    )
143
+                                );
144 144
                         break;
145 145
                 }
146 146
             }
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
             if ( $table->hasColumn ( $constrant[ "foreign_column" ] ) )
161 161
             {
162 162
                 $table->getColumn ( $constrant[ "foreign_column" ] )
163
-                      ->createDependece (
164
-                          $constrant[ 'constraint_name' ] ,
165
-                          $constrant[ 'table_name' ] ,
166
-                          $constrant[ 'column_name' ] ,
167
-                          $this->database ,
168
-                          $constrant[ 'table_schema' ]
169
-                      );
163
+                        ->createDependece (
164
+                            $constrant[ 'constraint_name' ] ,
165
+                            $constrant[ 'table_name' ] ,
166
+                            $constrant[ 'column_name' ] ,
167
+                            $this->database ,
168
+                            $constrant[ 'table_schema' ]
169
+                        );
170 170
             }
171 171
         }
172 172
     }
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
                             );
202 202
 
203 203
             $this->getTable ( $key , $schema )
204
-                 ->addColumn ( $column )
205
-                 ->setNamespace (
206
-                     $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
207
-                 );
204
+                    ->addColumn ( $column )
205
+                    ->setNamespace (
206
+                        $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
207
+                    );
208 208
         }
209 209
     }
210 210
 
@@ -279,13 +279,13 @@  discard block
 block discarded – undo
279 279
         }
280 280
 
281 281
         $this->objDbTables[ $schema ][ trim ( $nameTable ) ] = DbTable::getInstance ()
282
-                                                                      ->populate (
283
-                                                                          array (
284
-                                                                              'table'    => $nameTable ,
285
-                                                                              'schema'   => $schema ,
286
-                                                                              'database' => $this->database
287
-                                                                          )
288
-                                                                      );
282
+                                                                        ->populate (
283
+                                                                            array (
284
+                                                                                'table'    => $nameTable ,
285
+                                                                                'schema'   => $schema ,
286
+                                                                                'database' => $this->database
287
+                                                                            )
288
+                                                                        );
289 289
 
290 290
         return $this;
291 291
     }
Please login to merge, or discard this patch.
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     /**
68 68
      * @type \Classes\Db\Iterators\DbTables[]
69 69
      */
70
-    private $objDbTables = array ();
70
+    private $objDbTables = array();
71 71
 
72 72
     /**
73 73
      * @var AbstractAdapter
@@ -82,22 +82,22 @@  discard block
 block discarded – undo
82 82
     /**
83 83
      * analisa e popula as Foreing keys, Primary keys e dependencias do banco nos objetos
84 84
      */
85
-    protected function parseConstrants ()
85
+    protected function parseConstrants()
86 86
     {
87
-        foreach ( $this->getListConstrant () as $constrant )
87
+        foreach ($this->getListConstrant() as $constrant)
88 88
         {
89 89
 
90
-            $schema = $constrant[ 'table_schema' ];
91
-            $table_name = $constrant [ 'table_name' ];
92
-            $this->populateForeignAndPrimaryKeys ( $constrant , $table_name , $schema );
93
-            unset( $table_name , $schema );
90
+            $schema = $constrant['table_schema'];
91
+            $table_name = $constrant ['table_name'];
92
+            $this->populateForeignAndPrimaryKeys($constrant, $table_name, $schema);
93
+            unset($table_name, $schema);
94 94
 
95
-            if ( $constrant[ 'constraint_type' ] == "FOREIGN KEY" )
95
+            if ($constrant['constraint_type'] == "FOREIGN KEY")
96 96
             {
97
-                $schema = $constrant[ 'foreign_schema' ];
98
-                $table_name = $constrant [ 'foreign_table' ];
99
-                $this->populateDependece ( $constrant , $table_name , $schema );
100
-                unset( $table_name , $schema );
97
+                $schema = $constrant['foreign_schema'];
98
+                $table_name = $constrant ['foreign_table'];
99
+                $this->populateDependece($constrant, $table_name, $schema);
100
+                unset($table_name, $schema);
101 101
             }
102 102
         }
103 103
     }
@@ -107,37 +107,37 @@  discard block
 block discarded – undo
107 107
      * @param string $table_name
108 108
      * @param int    $schema
109 109
      */
110
-    private function populateForeignAndPrimaryKeys ( $constrant , $table_name , $schema = 0 )
110
+    private function populateForeignAndPrimaryKeys($constrant, $table_name, $schema = 0)
111 111
     {
112
-        if ( $this->hasTable ( $table_name , $schema ) )
112
+        if ($this->hasTable($table_name, $schema))
113 113
         {
114
-            $table = $this->getTable ( $table_name , $schema );
115
-            if ( $table->hasColumn ( $constrant[ "column_name" ] ) )
114
+            $table = $this->getTable($table_name, $schema);
115
+            if ($table->hasColumn($constrant["column_name"]))
116 116
             {
117
-                $objConstrant = Constrant::getInstance ()
118
-                                         ->populate (
119
-                                             array (
120
-                                                 'constrant' => $constrant[ 'constraint_name' ] ,
121
-                                                 'schema'    => $constrant[ 'foreign_schema' ] ,
122
-                                                 'table'     => $constrant[ 'foreign_table' ] ,
123
-                                                 'column'    => $constrant[ 'foreign_column' ] ,
117
+                $objConstrant = Constrant::getInstance()
118
+                                         ->populate(
119
+                                             array(
120
+                                                 'constrant' => $constrant['constraint_name'],
121
+                                                 'schema'    => $constrant['foreign_schema'],
122
+                                                 'table'     => $constrant['foreign_table'],
123
+                                                 'column'    => $constrant['foreign_column'],
124 124
                                                  'database'  => $this->database
125 125
                                              )
126 126
                                          );
127 127
 
128
-                switch ( $constrant[ 'constraint_type' ] )
128
+                switch ($constrant['constraint_type'])
129 129
                 {
130 130
                     case "FOREIGN KEY":
131
-                        $table->getColumn ( $constrant[ "column_name" ] )
132
-                              ->addRefFk ( $objConstrant );
131
+                        $table->getColumn($constrant["column_name"])
132
+                              ->addRefFk($objConstrant);
133 133
                         break;
134 134
                     case"PRIMARY KEY":
135
-                        $table->getColumn ( $constrant[ "column_name" ] )
136
-                              ->setPrimaryKey ( $objConstrant )
137
-                              ->setSequence (
138
-                                  $this->getSequence (
139
-                                      $table_name ,
140
-                                      $constrant[ "column_name" ] ,
135
+                        $table->getColumn($constrant["column_name"])
136
+                              ->setPrimaryKey($objConstrant)
137
+                              ->setSequence(
138
+                                  $this->getSequence(
139
+                                      $table_name,
140
+                                      $constrant["column_name"],
141 141
                                       $schema
142 142
                                   )
143 143
                               );
@@ -152,20 +152,20 @@  discard block
 block discarded – undo
152 152
      * @param string $table_name
153 153
      * @param int    $schema
154 154
      */
155
-    private function populateDependece ( $constrant , $table_name , $schema = 0 )
155
+    private function populateDependece($constrant, $table_name, $schema = 0)
156 156
     {
157
-        if ( $this->hasTable ( $table_name , $schema ) )
157
+        if ($this->hasTable($table_name, $schema))
158 158
         {
159
-            $table = $this->getTable ( $table_name , $schema );
160
-            if ( $table->hasColumn ( $constrant[ "foreign_column" ] ) )
159
+            $table = $this->getTable($table_name, $schema);
160
+            if ($table->hasColumn($constrant["foreign_column"]))
161 161
             {
162
-                $table->getColumn ( $constrant[ "foreign_column" ] )
163
-                      ->createDependece (
164
-                          $constrant[ 'constraint_name' ] ,
165
-                          $constrant[ 'table_name' ] ,
166
-                          $constrant[ 'column_name' ] ,
167
-                          $this->database ,
168
-                          $constrant[ 'table_schema' ]
162
+                $table->getColumn($constrant["foreign_column"])
163
+                      ->createDependece(
164
+                          $constrant['constraint_name'],
165
+                          $constrant['table_name'],
166
+                          $constrant['column_name'],
167
+                          $this->database,
168
+                          $constrant['table_schema']
169 169
                       );
170 170
             }
171 171
         }
@@ -174,36 +174,36 @@  discard block
 block discarded – undo
174 174
     /**
175 175
      * cria um Array com nome das tabelas
176 176
      */
177
-    public function parseTables ()
177
+    public function parseTables()
178 178
     {
179
-        if ( $this->hasTables () )
179
+        if ($this->hasTables())
180 180
         {
181
-            return $this->getAllTables ();
181
+            return $this->getAllTables();
182 182
         }
183 183
 
184
-        foreach ( $this->getListColumns () as $table )
184
+        foreach ($this->getListColumns() as $table)
185 185
         {
186
-            $schema = $table[ 'table_schema' ];
187
-            $key = $table [ 'table_name' ];
188
-            if ( ! $this->hasTable ( $key , $schema ) )
186
+            $schema = $table['table_schema'];
187
+            $key = $table ['table_name'];
188
+            if ( ! $this->hasTable($key, $schema))
189 189
             {
190
-                $this->createTable ( $key , $schema );
190
+                $this->createTable($key, $schema);
191 191
             }
192 192
 
193
-            $column = Column::getInstance ()
194
-                            ->populate (
195
-                                array (
196
-                                    'name'       => $table [ 'column_name' ] ,
197
-                                    'type'       => $this->convertTypeToSimple ( $table[ 'data_type' ] ) ,
198
-                                    'nullable'   => (is_string($table[ 'is_nullable' ]) && strtolower($table[ 'is_nullable' ]) != 'no' ) ,
199
-                                    'max_length' => $table[ 'max_length' ]
193
+            $column = Column::getInstance()
194
+                            ->populate(
195
+                                array(
196
+                                    'name'       => $table ['column_name'],
197
+                                    'type'       => $this->convertTypeToSimple($table['data_type']),
198
+                                    'nullable'   => (is_string($table['is_nullable']) && strtolower($table['is_nullable']) != 'no'),
199
+                                    'max_length' => $table['max_length']
200 200
                                 )
201 201
                             );
202 202
 
203
-            $this->getTable ( $key , $schema )
204
-                 ->addColumn ( $column )
205
-                 ->setNamespace (
206
-                     $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
203
+            $this->getTable($key, $schema)
204
+                 ->addColumn($column)
205
+                 ->setNamespace(
206
+                     $this->config->createClassNamespace($this->getTable($key, $schema))
207 207
                  );
208 208
         }
209 209
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      *
214 214
      * @return int
215 215
      */
216
-    abstract public function getTotalTables ();
216
+    abstract public function getTotalTables();
217 217
 
218 218
     /**
219 219
      * Retorna o Nome da Sequence da tabela
@@ -223,33 +223,33 @@  discard block
 block discarded – undo
223 223
      *
224 224
      * @return string
225 225
      */
226
-    abstract public function getSequence ( $table , $column , $schema = 0 );
226
+    abstract public function getSequence($table, $column, $schema = 0);
227 227
 
228 228
     /**
229 229
      * @return array
230 230
      */
231
-    abstract public function getListConstrant ();
231
+    abstract public function getListConstrant();
232 232
 
233 233
     /**
234 234
      * @param string $str
235 235
      *
236 236
      * @return string
237 237
      */
238
-    protected function convertTypeToPhp ( $str )
238
+    protected function convertTypeToPhp($str)
239 239
     {
240
-        if ( isset( $this->dataTypesToPhp[ $str ] ) )
240
+        if (isset($this->dataTypesToPhp[$str]))
241 241
         {
242
-            return $this->dataTypesToPhp[ $str ];
242
+            return $this->dataTypesToPhp[$str];
243 243
         }
244 244
 
245 245
         return 'string';
246 246
     }
247 247
 
248
-    protected function convertTypeToSimple ( $str )
248
+    protected function convertTypeToSimple($str)
249 249
     {
250
-        if ( isset( $this->dataTypesToSimple[ $str ] ) )
250
+        if (isset($this->dataTypesToSimple[$str]))
251 251
         {
252
-            return $this->dataTypesToSimple[ $str ];
252
+            return $this->dataTypesToSimple[$str];
253 253
         }
254 254
 
255 255
         return 'string';
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
     /**
259 259
      * @return string
260 260
      */
261
-    abstract public function getPDOString ();
261
+    abstract public function getPDOString();
262 262
 
263 263
     /**
264 264
      * @return string
265 265
      */
266
-    abstract public function getPDOSocketString ();
266
+    abstract public function getPDOSocketString();
267 267
 
268 268
     /**
269 269
      * @param     $nameTable
@@ -271,18 +271,18 @@  discard block
 block discarded – undo
271 271
      *
272 272
      * @return \Classes\Db\DbTable
273 273
      */
274
-    public function createTable ( $nameTable , $schema = 0 )
274
+    public function createTable($nameTable, $schema = 0)
275 275
     {
276
-        if ( ! isset( $this->objDbTables[ $schema ] ) )
276
+        if ( ! isset($this->objDbTables[$schema]))
277 277
         {
278
-            $this->objDbTables[ $schema ] = new DbTables();
278
+            $this->objDbTables[$schema] = new DbTables();
279 279
         }
280 280
 
281
-        $this->objDbTables[ $schema ][ trim ( $nameTable ) ] = DbTable::getInstance ()
282
-                                                                      ->populate (
283
-                                                                          array (
284
-                                                                              'table'    => $nameTable ,
285
-                                                                              'schema'   => $schema ,
281
+        $this->objDbTables[$schema][trim($nameTable)] = DbTable::getInstance()
282
+                                                                      ->populate(
283
+                                                                          array(
284
+                                                                              'table'    => $nameTable,
285
+                                                                              'schema'   => $schema,
286 286
                                                                               'database' => $this->database
287 287
                                                                           )
288 288
                                                                       );
@@ -295,24 +295,24 @@  discard block
 block discarded – undo
295 295
      *
296 296
      * @return \Classes\Db\Iterators\DbTables
297 297
      */
298
-    public function getTables ( $schema = 0 )
298
+    public function getTables($schema = 0)
299 299
     {
300
-        if ( ! isset( $this->objDbTables[ $schema ] ) )
300
+        if ( ! isset($this->objDbTables[$schema]))
301 301
         {
302
-            return array ();
302
+            return array();
303 303
         }
304 304
 
305
-        return $this->objDbTables[ $schema ];
305
+        return $this->objDbTables[$schema];
306 306
     }
307 307
 
308
-    public function getAllTables ()
308
+    public function getAllTables()
309 309
     {
310 310
         return $this->objDbTables;
311 311
     }
312 312
 
313
-    public function hasTables ()
313
+    public function hasTables()
314 314
     {
315
-        return ! empty( $this->objDbTables );
315
+        return ! empty($this->objDbTables);
316 316
     }
317 317
 
318 318
     /**
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
      *
323 323
      * @return \Classes\Db\DbTable
324 324
      */
325
-    public function getTable ( $nameTable , $schema = 0 )
325
+    public function getTable($nameTable, $schema = 0)
326 326
     {
327
-        return $this->objDbTables[ $schema ][ trim ( $nameTable ) ];
327
+        return $this->objDbTables[$schema][trim($nameTable)];
328 328
     }
329 329
 
330 330
     /**
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
      *
334 334
      * @return bool
335 335
      */
336
-    public function hasTable ( $nameTable , $schema = 0 )
336
+    public function hasTable($nameTable, $schema = 0)
337 337
     {
338
-        return isset( $this->objDbTables[ $schema ][ trim ( $nameTable ) ] );
338
+        return isset($this->objDbTables[$schema][trim($nameTable)]);
339 339
     }
340 340
 
341 341
     /**
@@ -343,66 +343,66 @@  discard block
 block discarded – undo
343 343
      *
344 344
      * @return array[]
345 345
      */
346
-    abstract public function getListColumns ();
346
+    abstract public function getListColumns();
347 347
 
348 348
     /**
349 349
      * Retorna um Array com nome das tabelas
350 350
      *
351 351
      * @return string[]
352 352
      */
353
-    abstract public function getListNameTable ();
353
+    abstract public function getListNameTable();
354 354
 
355 355
     /**
356 356
      * @param \Classes\AdapterConfig\AbstractAdapter $adapterConfig
357 357
      */
358
-    public function __construct ( AbstractAdapter $adapterConfig )
358
+    public function __construct(AbstractAdapter $adapterConfig)
359 359
     {
360 360
         $this->config = $adapterConfig;
361
-        $this->host = $adapterConfig->getHost ();
362
-        $this->database = $adapterConfig->getDatabase ();
363
-        $this->port = $adapterConfig->hasPort () ? $adapterConfig->getPort ()
361
+        $this->host = $adapterConfig->getHost();
362
+        $this->database = $adapterConfig->getDatabase();
363
+        $this->port = $adapterConfig->hasPort() ? $adapterConfig->getPort()
364 364
             : $this->port;
365
-        $this->username = $adapterConfig->getUser ();
366
-        $this->password = $adapterConfig->getPassword ();
367
-        $this->socket = $adapterConfig->getSocket ();
368
-        $this->tablesName = $adapterConfig->hasTablesName ()
369
-            ? $adapterConfig->getListTablesName () : '';
365
+        $this->username = $adapterConfig->getUser();
366
+        $this->password = $adapterConfig->getPassword();
367
+        $this->socket = $adapterConfig->getSocket();
368
+        $this->tablesName = $adapterConfig->hasTablesName()
369
+            ? $adapterConfig->getListTablesName() : '';
370 370
 
371 371
     }
372 372
 
373 373
     /**
374 374
      * Executa as consultas do banco de dados
375 375
      */
376
-    public function runDatabase ()
376
+    public function runDatabase()
377 377
     {
378
-        $this->parseTables ();
379
-        $this->parseConstrants ();
378
+        $this->parseTables();
379
+        $this->parseConstrants();
380 380
     }
381 381
 
382 382
     /**
383 383
      *
384 384
      * @return \PDO
385 385
      */
386
-    public function getPDO ()
386
+    public function getPDO()
387 387
     {
388
-        if ( is_null ( $this->_pdo ) )
388
+        if (is_null($this->_pdo))
389 389
         {
390
-            if ( ! empty( $this->socket ) )
390
+            if ( ! empty($this->socket))
391 391
             {
392
-                $pdoString = $this->getPDOSocketString ();
392
+                $pdoString = $this->getPDOSocketString();
393 393
             } else
394 394
             {
395
-                $pdoString = $this->getPDOString ();
395
+                $pdoString = $this->getPDOString();
396 396
             }
397 397
 
398 398
             try
399 399
             {
400
-                $this->_pdo = new \PDO (
401
-                    $pdoString , $this->username , $this->password
400
+                $this->_pdo = new \PDO(
401
+                    $pdoString, $this->username, $this->password
402 402
                 );
403
-            } catch ( \Exception $e )
403
+            } catch (\Exception $e)
404 404
             {
405
-                die ( "\033[0;31mPDO error: " . $e->getMessage () . "\033[0m\n" );
405
+                die ("\033[0;31mPDO error: " . $e->getMessage() . "\033[0m\n");
406 406
             }
407 407
         }
408 408
 
Please login to merge, or discard this patch.
build/Classes/Db/Column.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     /**
151 151
      * @param AbstractAdapter $type
152 152
      *
153
-     * @return mixed
153
+     * @return string
154 154
      */
155 155
     public function getTypeByConfig ( AbstractAdapter $type )
156 156
     {
@@ -199,6 +199,7 @@  discard block
 block discarded – undo
199 199
      * @param $constraint_name
200 200
      * @param $table_name
201 201
      * @param $column_name
202
+     * @param string $database
202 203
      *
203 204
      * @return $this
204 205
      */
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -205,15 +205,15 @@
 block discarded – undo
205 205
     public function createDependece ( $constraint_name, $table_name, $column_name, $database, $schema = null )
206 206
     {
207 207
         $objConstrantDependence = Constrant::getInstance ()
208
-                                           ->populate (
209
-                                               array (
210
-                                                   'constrant' => $constraint_name,
211
-                                                   'schema'    => $schema,
212
-                                                   'table'     => $table_name,
213
-                                                   'column'    => $column_name,
214
-                                                   'database'  => $database
215
-                                               )
216
-                                           );
208
+                                            ->populate (
209
+                                                array (
210
+                                                    'constrant' => $constraint_name,
211
+                                                    'schema'    => $schema,
212
+                                                    'table'     => $table_name,
213
+                                                    'column'    => $column_name,
214
+                                                    'database'  => $database
215
+                                                )
216
+                                            );
217 217
 
218 218
         $this->addDependece ( $objConstrantDependence );
219 219
 
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      *
19 19
      * @author Pedro Alarcao <[email protected]>
20 20
      */
21
-    final private function __construct ()
21
+    final private function __construct()
22 22
     {
23 23
     }
24 24
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @return \Classes\Db\Column
29 29
      */
30
-    public static function getInstance ()
30
+    public static function getInstance()
31 31
     {
32 32
         return new Column();
33 33
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     /**
81 81
      * @return string
82 82
      */
83
-    public function getName ()
83
+    public function getName()
84 84
     {
85 85
         return $this->name;
86 86
     }
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
      *
91 91
      * @param $array
92 92
      */
93
-    public function populate ( $array )
93
+    public function populate($array)
94 94
     {
95
-        $this->name       = $array[ 'name' ];
96
-        $this->type       = $array[ 'type' ];
97
-        $this->nullable   = $array[ 'nullable' ];
98
-        $this->max_length = $array[ 'max_length' ];
95
+        $this->name       = $array['name'];
96
+        $this->type       = $array['type'];
97
+        $this->nullable   = $array['nullable'];
98
+        $this->max_length = $array['max_length'];
99 99
 
100 100
         return $this;
101 101
     }
@@ -103,37 +103,37 @@  discard block
 block discarded – undo
103 103
     /**
104 104
      * @return boolean
105 105
      */
106
-    public function isPrimaryKey ()
106
+    public function isPrimaryKey()
107 107
     {
108
-        return !empty( $this->primarykey );
108
+        return ! empty($this->primarykey);
109 109
     }
110 110
 
111 111
     /**
112 112
      * @return boolean
113 113
      */
114
-    public function isForeingkey ()
114
+    public function isForeingkey()
115 115
     {
116
-        return !empty( $this->refForeingkey );
116
+        return ! empty($this->refForeingkey);
117 117
     }
118 118
 
119 119
     /**
120 120
      * @return boolean
121 121
      */
122
-    public function hasDependence ()
122
+    public function hasDependence()
123 123
     {
124
-        return !empty( $this->dependences );
124
+        return ! empty($this->dependences);
125 125
     }
126 126
 
127 127
     /**
128 128
      * @return string
129 129
      */
130
-    public function getType ( $inPHP = true )
130
+    public function getType($inPHP = true)
131 131
     {
132
-        if ( !$inPHP ) {
132
+        if ( ! $inPHP) {
133 133
             return $this->type;
134 134
         }
135 135
 
136
-        return AbstractAdapter::convertTypeToPHP ( $this->type );
136
+        return AbstractAdapter::convertTypeToPHP($this->type);
137 137
     }
138 138
 
139 139
     /**
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
      *
143 143
      * @return bool
144 144
      */
145
-    public function equalType ( $type, $inPHP = true )
145
+    public function equalType($type, $inPHP = true)
146 146
     {
147
-        return $this->getType ( $inPHP ) === $type;
147
+        return $this->getType($inPHP) === $type;
148 148
     }
149 149
 
150 150
     /**
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
      *
153 153
      * @return mixed
154 154
      */
155
-    public function getTypeByConfig ( AbstractAdapter $type )
155
+    public function getTypeByConfig(AbstractAdapter $type)
156 156
     {
157
-        return $type->convertTypeToTypeFramework ( $this->getType ( false ) );
157
+        return $type->convertTypeToTypeFramework($this->getType(false));
158 158
     }
159 159
 
160 160
     /**
161 161
      * @return string
162 162
      */
163
-    public function getComment ()
163
+    public function getComment()
164 164
     {
165 165
         return $this->comment;
166 166
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     /**
169 169
      * @param string $comment
170 170
      */
171
-    public function setComment ( $comment )
171
+    public function setComment($comment)
172 172
     {
173 173
         $this->comment = $comment;
174 174
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     /**
179 179
      * @param \Classes\Db\Constrant $primarykey
180 180
      */
181
-    public function setPrimaryKey ( Constrant $primarykey )
181
+    public function setPrimaryKey(Constrant $primarykey)
182 182
     {
183 183
         $this->primarykey = $primarykey;
184 184
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     /**
189 189
      * @param \Classes\Db\Constrant $dependece
190 190
      */
191
-    public function addDependece ( Constrant $dependece )
191
+    public function addDependece(Constrant $dependece)
192 192
     {
193 193
         $this->dependences[] = $dependece;
194 194
 
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
      *
203 203
      * @return $this
204 204
      */
205
-    public function createDependece ( $constraint_name, $table_name, $column_name, $database, $schema = null )
205
+    public function createDependece($constraint_name, $table_name, $column_name, $database, $schema = null)
206 206
     {
207
-        $objConstrantDependence = Constrant::getInstance ()
208
-                                           ->populate (
209
-                                               array (
207
+        $objConstrantDependence = Constrant::getInstance()
208
+                                           ->populate(
209
+                                               array(
210 210
                                                    'constrant' => $constraint_name,
211 211
                                                    'schema'    => $schema,
212 212
                                                    'table'     => $table_name,
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                                                )
216 216
                                            );
217 217
 
218
-        $this->addDependece ( $objConstrantDependence );
218
+        $this->addDependece($objConstrantDependence);
219 219
 
220 220
         return $this;
221 221
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     /**
224 224
      * @param \Classes\Db\Constrant $reference
225 225
      */
226
-    public function addRefFk ( Constrant $reference )
226
+    public function addRefFk(Constrant $reference)
227 227
     {
228 228
         $this->refForeingkey = $reference;
229 229
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
      *
236 236
      * @return \Classes\Db\Constrant
237 237
      */
238
-    public function getFks ()
238
+    public function getFks()
239 239
     {
240 240
         return $this->refForeingkey;
241 241
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      *
246 246
      * @return \Classes\Db\Constrant[]
247 247
      */
248
-    public function getDependences ()
248
+    public function getDependences()
249 249
     {
250 250
         return $this->dependences;
251 251
     }
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
     /**
254 254
      * @return bool
255 255
      */
256
-    public function hasDependences ()
256
+    public function hasDependences()
257 257
     {
258
-        return (bool) count ( $this->dependences );
258
+        return (bool) count($this->dependences);
259 259
     }
260 260
 
261 261
     /**
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      *
264 264
      * @return \Classes\Db\Constrant[]
265 265
      */
266
-    public function getPrimaryKey ()
266
+    public function getPrimaryKey()
267 267
     {
268 268
         return $this->primarykey;
269 269
     }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     /**
272 272
      *
273 273
      */
274
-    public function getMaxLength ()
274
+    public function getMaxLength()
275 275
     {
276 276
         return $this->max_length;
277 277
     }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     /**
280 280
      * @return bool
281 281
      */
282
-    public function hasSequence ()
282
+    public function hasSequence()
283 283
     {
284 284
         return (bool) $this->sequence;
285 285
     }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     /**
288 288
      * @return string
289 289
      */
290
-    public function getSequence ()
290
+    public function getSequence()
291 291
     {
292 292
         return $this->sequence;
293 293
     }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     /**
296 296
      * @param string $sequence
297 297
      */
298
-    public function setSequence ( $sequence )
298
+    public function setSequence($sequence)
299 299
     {
300 300
         $this->sequence = $sequence;
301 301
     }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     /**
304 304
      * @return boolean
305 305
      */
306
-    public function isNullable ()
306
+    public function isNullable()
307 307
     {
308 308
         return $this->nullable;
309 309
     }
Please login to merge, or discard this patch.