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 ( 85b2a1...28feed )
by Pedro
07:16 queued 04:34
created
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.
build/Classes/templates/phalcon/entity_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/AdaptersDriver/Mysql.php 3 patches
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -35,26 +35,19 @@
 block discarded – undo
35 35
         $res = '';
36 36
         if ( preg_match ( '/(tinyint\(1\)|bit)/', $str ) ) {
37 37
             $res = 'boolean';
38
-        }
39
-        elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) {
38
+        } elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) {
40 39
             $res = 'string';
41
-        }
42
-        elseif ( preg_match ( '/(text)/', $str ) ) {
40
+        } elseif ( preg_match ( '/(text)/', $str ) ) {
43 41
             $res = 'text';
44
-        }
45
-        elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) {
42
+        } elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) {
46 43
             $res = 'float';
47
-        }
48
-        elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) {
44
+        } elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) {
49 45
             $res = $matches[ 1 ];
50
-        }
51
-        elseif ( preg_match ( '/(date)/', $str ) ) {
46
+        } elseif ( preg_match ( '/(date)/', $str ) ) {
52 47
             $res = 'date';
53
-        }
54
-        elseif ( preg_match ( '/(datetime)/', $str ) ) {
48
+        } elseif ( preg_match ( '/(datetime)/', $str ) ) {
55 49
             $res = 'datetime';
56
-        }
57
-        else {
50
+        } else {
58 51
             print "Can't convert column type to Simple - Unrecognized type: $str";
59 52
         }
60 53
 
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
             $sqlTables = !empty($this->tablesName)?"AND table_name IN ( $this->tablesName )":'';
175 175
 
176 176
             $this->totalTables = $this->getPDO ()
177
-                                      ->query (
178
-                                          "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{$this->database}' $sqlTables"
179
-                                      )
180
-                                      ->fetchColumn ();
177
+                                        ->query (
178
+                                            "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{$this->database}' $sqlTables"
179
+                                        )
180
+                                        ->fetchColumn ();
181 181
         }
182 182
 
183 183
         return (int) $this->totalTables;
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
     public function getSequence ( $table, $column, $schema = 0 )
195 195
     {
196 196
         $return = $this->getPDO ()
197
-                       ->query (
198
-                           "select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';"
199
-                       )
200
-                       ->fetch ( \PDO::FETCH_ASSOC );
197
+                        ->query (
198
+                            "select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';"
199
+                        )
200
+                        ->fetch ( \PDO::FETCH_ASSOC );
201 201
 
202 202
         if ( !$return ) {
203 203
             return;
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -30,28 +30,28 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return string
32 32
      */
33
-    protected function convertTypeToSimple ( $str )
33
+    protected function convertTypeToSimple($str)
34 34
     {
35 35
         $res = '';
36
-        if ( preg_match ( '/(tinyint\(1\)|bit)/', $str ) ) {
36
+        if (preg_match('/(tinyint\(1\)|bit)/', $str)) {
37 37
             $res = 'boolean';
38 38
         }
39
-        elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) {
39
+        elseif (preg_match('/(timestamp|blob|char|enum)/', $str)) {
40 40
             $res = 'string';
41 41
         }
42
-        elseif ( preg_match ( '/(text)/', $str ) ) {
42
+        elseif (preg_match('/(text)/', $str)) {
43 43
             $res = 'text';
44 44
         }
45
-        elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) {
45
+        elseif (preg_match('/(decimal|numeric|float|double)/', $str)) {
46 46
             $res = 'float';
47 47
         }
48
-        elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) {
49
-            $res = $matches[ 1 ];
48
+        elseif (preg_match('#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches)) {
49
+            $res = $matches[1];
50 50
         }
51
-        elseif ( preg_match ( '/(date)/', $str ) ) {
51
+        elseif (preg_match('/(date)/', $str)) {
52 52
             $res = 'date';
53 53
         }
54
-        elseif ( preg_match ( '/(datetime)/', $str ) ) {
54
+        elseif (preg_match('/(datetime)/', $str)) {
55 55
             $res = 'datetime';
56 56
         }
57 57
         else {
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      * @inheritDoc
66 66
      * @return string
67 67
      */
68
-    public function getPDOString ()
68
+    public function getPDOString()
69 69
     {
70
-        return sprintf (
70
+        return sprintf(
71 71
             "mysql:host=%s;port=%s;dbname=%s",
72 72
             $this->host,
73 73
             $this->port,
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
      * @inheritDoc
81 81
      * @return string
82 82
      */
83
-    public function getPDOSocketString ()
83
+    public function getPDOSocketString()
84 84
     {
85
-        return sprintf (
85
+        return sprintf(
86 86
             "mysql:unix_socket=%s;dbname=%s",
87 87
             $this->socket,
88 88
             $this->database
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
      * @inheritDoc
95 95
      * @return string[]
96 96
      */
97
-    public function getListNameTable ()
97
+    public function getListNameTable()
98 98
     {
99
-        if ( empty( $this->tableList ) ) {
100
-            $this->tableList = $this->getPDO ()
101
-                                    ->query (
99
+        if (empty($this->tableList)) {
100
+            $this->tableList = $this->getPDO()
101
+                                    ->query(
102 102
                                         "show tables"
103 103
                                     )
104
-                                    ->fetchAll ();
104
+                                    ->fetchAll();
105 105
         }
106 106
 
107 107
         return $this->tableList;
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
      *
113 113
      * @return array[]
114 114
      */
115
-    public function getListColumns ()
115
+    public function getListColumns()
116 116
     {
117
-        $sqlTables = !empty($this->tablesName)?"AND table_name IN ( $this->tablesName )":'';
117
+        $sqlTables = ! empty($this->tablesName) ? "AND table_name IN ( $this->tablesName )" : '';
118 118
 
119
-        return $this->getPDO ()
120
-                    ->query (
119
+        return $this->getPDO()
120
+                    ->query(
121 121
                         "select
122 122
                 0 AS table_schema,
123 123
                 table_name,
@@ -129,18 +129,18 @@  discard block
 block discarded – undo
129 129
             where table_schema IN ('{$this->database}') $sqlTables
130 130
             order by table_name,ordinal_position"
131 131
                     )
132
-                    ->fetchAll ( \PDO::FETCH_ASSOC );
132
+                    ->fetchAll(\PDO::FETCH_ASSOC);
133 133
     }
134 134
 
135 135
     /**
136 136
      * @return array
137 137
      */
138
-    public function getListConstrant ()
138
+    public function getListConstrant()
139 139
     {
140
-        $sqlTables = !empty($this->tablesName)?"AND k.table_name IN ( $this->tablesName )":'';
140
+        $sqlTables = ! empty($this->tablesName) ? "AND k.table_name IN ( $this->tablesName )" : '';
141 141
 
142
-        $objQuery = $this->getPDO ()
143
-                    ->query (
142
+        $objQuery = $this->getPDO()
143
+                    ->query(
144 144
                         "SELECT distinct
145 145
      i.constraint_type,
146 146
      k.constraint_name,
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 i.TABLE_SCHEMA IN ('{$this->database}') AND i.CONSTRAINT_TYPE IN ('FOREIGN KEY', 'PRIMARY KEY' ) $sqlTables
160 160
 order by k.table_schema, k.table_name;"
161 161
                     );
162
-        return $objQuery?$objQuery->fetchAll ( \PDO::FETCH_ASSOC ):array();
162
+        return $objQuery ? $objQuery->fetchAll(\PDO::FETCH_ASSOC) : array();
163 163
     }
164 164
 
165 165
     /**
@@ -167,17 +167,17 @@  discard block
 block discarded – undo
167 167
      *
168 168
      * @return int
169 169
      */
170
-    public function getTotalTables ()
170
+    public function getTotalTables()
171 171
     {
172
-        if ( empty( $this->totalTables ) ) {
172
+        if (empty($this->totalTables)) {
173 173
 
174
-            $sqlTables = !empty($this->tablesName)?"AND table_name IN ( $this->tablesName )":'';
174
+            $sqlTables = ! empty($this->tablesName) ? "AND table_name IN ( $this->tablesName )" : '';
175 175
 
176
-            $this->totalTables = $this->getPDO ()
177
-                                      ->query (
176
+            $this->totalTables = $this->getPDO()
177
+                                      ->query(
178 178
                                           "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{$this->database}' $sqlTables"
179 179
                                       )
180
-                                      ->fetchColumn ();
180
+                                      ->fetchColumn();
181 181
         }
182 182
 
183 183
         return (int) $this->totalTables;
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
      *
192 192
      * @return string
193 193
      */
194
-    public function getSequence ( $table, $column, $schema = 0 )
194
+    public function getSequence($table, $column, $schema = 0)
195 195
     {
196
-        $return = $this->getPDO ()
197
-                       ->query (
196
+        $return = $this->getPDO()
197
+                       ->query(
198 198
                            "select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';"
199 199
                        )
200
-                       ->fetch ( \PDO::FETCH_ASSOC );
200
+                       ->fetch(\PDO::FETCH_ASSOC);
201 201
 
202
-        if ( !$return ) {
202
+        if ( ! $return) {
203 203
             return;
204 204
         }
205 205
 
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/Phalcon.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
      * @var string
23 23
      */
24 24
     protected $framework    = "phalcon";
25
-    public    $reservedWord = array ( 'public' => 'Main' );
25
+    public    $reservedWord = array('public' => 'Main');
26 26
 
27
-    protected $dataTypes = array (
27
+    protected $dataTypes = array(
28 28
         'int'    => 'integer',
29 29
         'float'  => 'decimal'
30 30
     );
31 31
 
32 32
     const SEPARETOR = "\\";
33 33
 
34
-    protected function init ()
34
+    protected function init()
35 35
     {
36 36
     }
37 37
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return array
42 42
      */
43
-    protected function getParams ()
43
+    protected function getParams()
44 44
     {
45 45
 
46 46
     }
47 47
 
48
-    protected function parseFrameworkConfig ()
48
+    protected function parseFrameworkConfig()
49 49
     {
50 50
         // TODO: Implement parseFrameworkConfig() method.
51 51
     }
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * @inheritdoc
55 55
      */
56
-    protected function getBaseNamespace ()
56
+    protected function getBaseNamespace()
57 57
     {
58
-        return array (
59
-            $this->arrConfig[ 'namespace' ],
58
+        return array(
59
+            $this->arrConfig['namespace'],
60 60
             'Models'
61 61
         );
62 62
     }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
68 68
      */
69
-    public function getMakeFileInstances ()
69
+    public function getMakeFileInstances()
70 70
     {
71
-        return array (
72
-            Entity::getInstance (),
73
-            Model::getInstance (),
74
-            Peer::getInstance ()
71
+        return array(
72
+            Entity::getInstance(),
73
+            Model::getInstance(),
74
+            Peer::getInstance()
75 75
         );
76 76
     }
77 77
 
Please login to merge, or discard this patch.
build/Classes/MakerFile.php 4 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -99,6 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     /**
101 101
      * Analisa os caminhos das pastas base
102
+     * @param string $basePath
102 103
      */
103 104
     public function parseLocation ( $basePath )
104 105
     {
@@ -227,6 +228,9 @@  discard block
 block discarded – undo
227 228
         echo "\n\033[1;32mSuccessfully process finished!\n\033[0m";
228 229
     }
229 230
 
231
+    /**
232
+     * @param integer $cur
233
+     */
230 234
     private function waitOfDatabase ( &$cur )
231 235
     {
232 236
         printf ( "\033[1;33mWait, the database is being analyzed..\033[0m\n" );
@@ -293,6 +297,7 @@  discard block
 block discarded – undo
293 297
      * parse a tpl file and return the result
294 298
      *
295 299
      * @param String $tplFile
300
+     * @param AbstractAdapter $objMakeFile
296 301
      *
297 302
      * @return String
298 303
      */
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
                 unset( $arrUrl );
137 137
             }
138 138
 
139
-        }
140
-        else {
139
+        } else {
141 140
             $url            = array (
142 141
                 $this->baseLocation,
143 142
                 $driverBase,
@@ -213,8 +212,7 @@  discard block
 block discarded – undo
213 212
                     );
214 213
                     if ( self::makeSourcer ( $file, $tpl, $objMakeFile->isOverwrite () ) ) {
215 214
                         ++$numFilesCreated;
216
-                    }
217
-                    else {
215
+                    } else {
218 216
                         ++$numFilesIgnored;
219 217
                     }
220 218
 
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
         foreach ( $arrFoldersName as $index => $folderName ) {
96 96
             $arrFoldersName[ $index ] = $this->getConfig ()
97
-                                             ->replaceReservedWord ( $folderName );
97
+                                                ->replaceReservedWord ( $folderName );
98 98
         }
99 99
 
100 100
         return implode ( DIRECTORY_SEPARATOR, array_filter ( $arrFoldersName ) );
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                 $folderName,
148 148
                 $this->getClassName (
149 149
                     $this->getConfig ()
150
-                         ->getDatabase ()
150
+                            ->getDatabase ()
151 151
                 )
152 152
             );
153 153
             $this->location = array ( $this->filterLocation ( $url ) );
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
         if ( $objFilesFixeds->hasData() )
184 184
         {
185 185
             $file = $this->baseLocation
186
-                             . DIRECTORY_SEPARATOR
187
-                             . $objFilesFixeds->getFileName()
188
-                             . '.php';
186
+                                . DIRECTORY_SEPARATOR
187
+                                . $objFilesFixeds->getFileName()
188
+                                . '.php';
189 189
 
190 190
             $tpl = $this->getParsedTplContents ( $objFilesFixeds->getTpl() );
191 191
             self::makeSourcer ( $file , $tpl , true );
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      * @return String
320 320
      */
321 321
     protected function getParsedTplContents ( $tplFile, $vars = array (), \Classes\Db\DbTable $objTables = null,
322
-                                              $objMakeFile = null )
322
+                                                $objMakeFile = null )
323 323
     {
324 324
 
325 325
         $arrUrl = array (
Please login to merge, or discard this patch.
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * @type string[]
23 23
      */
24
-    public $location = array ();
24
+    public $location = array();
25 25
 
26 26
     /**
27 27
      * caminho de pastas Base
@@ -45,42 +45,42 @@  discard block
 block discarded – undo
45 45
 
46 46
     private $msgReservedWord = "\033[0mPlease enter the value for reserved word \033[0;31m'%index%' \033[1;33m[%config%]:\033[0m ";
47 47
 
48
-    public function __construct ( Config $config )
48
+    public function __construct(Config $config)
49 49
     {
50
-        $this->config = $config->getAdapterConfig ();
51
-        $this->parseReservedWord ( $this->getConfig () );
52
-        $this->driver = $config->getAdapterDriver ( $this->getConfig () );
53
-        $this->parseLocation ( $config->_basePath );
50
+        $this->config = $config->getAdapterConfig();
51
+        $this->parseReservedWord($this->getConfig());
52
+        $this->driver = $config->getAdapterDriver($this->getConfig());
53
+        $this->parseLocation($config->_basePath);
54 54
     }
55 55
 
56 56
     /**
57 57
      * @param AdapterConfig\AbstractAdapter $config
58 58
      */
59
-    public function parseReservedWord ( AdapterConfig\AbstractAdapter $config )
59
+    public function parseReservedWord(AdapterConfig\AbstractAdapter $config)
60 60
     {
61 61
         $palavrasReservadas = $config->reservedWord;
62
-        if ( !$palavrasReservadas ) {
62
+        if ( ! $palavrasReservadas) {
63 63
             return;
64 64
         }
65 65
 
66
-        $schema      = $config->getSchemas ();
67
-        $db          = $config->getDatabase ();
68
-        $hasSchema   = array_intersect ( $schema, array_flip ( $palavrasReservadas ) );
69
-        $hasDatabase = in_array ( $db, $palavrasReservadas );
70
-        if ( !( $hasSchema or $hasDatabase ) ) {
66
+        $schema      = $config->getSchemas();
67
+        $db          = $config->getDatabase();
68
+        $hasSchema   = array_intersect($schema, array_flip($palavrasReservadas));
69
+        $hasDatabase = in_array($db, $palavrasReservadas);
70
+        if ( ! ($hasSchema or $hasDatabase)) {
71 71
             return;
72 72
         }
73 73
 
74 74
         echo "- database has reserved words\n";
75
-        foreach ( $palavrasReservadas as $index => $config ) {
76
-            $attribs = array (
75
+        foreach ($palavrasReservadas as $index => $config) {
76
+            $attribs = array(
77 77
                 "%index%"  => $index,
78 78
                 "%config%" => $config
79 79
             );
80
-            echo strtr ( $this->msgReservedWord, $attribs );
81
-            $line = trim ( fgets ( STDIN ) );
82
-            if ( !empty( $line ) ) {
83
-                $this->getConfig ()->reservedWord[ $index ] = $line;
80
+            echo strtr($this->msgReservedWord, $attribs);
81
+            $line = trim(fgets(STDIN));
82
+            if ( ! empty($line)) {
83
+                $this->getConfig()->reservedWord[$index] = $line;
84 84
             }
85 85
         }
86 86
     }
@@ -90,193 +90,193 @@  discard block
 block discarded – undo
90 90
      *
91 91
      * @return string
92 92
      */
93
-    private function filterLocation ( $arrFoldersName )
93
+    private function filterLocation($arrFoldersName)
94 94
     {
95
-        foreach ( $arrFoldersName as $index => $folderName ) {
96
-            $arrFoldersName[ $index ] = $this->getConfig ()
97
-                                             ->replaceReservedWord ( $folderName );
95
+        foreach ($arrFoldersName as $index => $folderName) {
96
+            $arrFoldersName[$index] = $this->getConfig()
97
+                                             ->replaceReservedWord($folderName);
98 98
         }
99 99
 
100
-        return implode ( DIRECTORY_SEPARATOR, array_filter ( $arrFoldersName ) );
100
+        return implode(DIRECTORY_SEPARATOR, array_filter($arrFoldersName));
101 101
     }
102 102
 
103 103
     /**
104 104
      * Analisa os caminhos das pastas base
105 105
      */
106
-    public function parseLocation ( $basePath )
106
+    public function parseLocation($basePath)
107 107
     {
108 108
 
109
-        $arrBase = array (
109
+        $arrBase = array(
110 110
             $basePath,
111 111
             $this->config->path
112 112
         );
113 113
 
114
-        $this->baseLocation = $this->filterLocation ( $arrBase );
114
+        $this->baseLocation = $this->filterLocation($arrBase);
115 115
 
116 116
         # pasta com nome do driver do banco
117 117
         $driverBase = '';
118
-        if ( (bool) @$this->config->{"folder-database"} ) {
119
-            $classDriver = explode ( '\\', get_class ( $this->driver ) );
120
-            $driverBase  = end ( $classDriver );
118
+        if ((bool) @$this->config->{"folder-database"} ) {
119
+            $classDriver = explode('\\', get_class($this->driver));
120
+            $driverBase  = end($classDriver);
121 121
         }
122 122
         $folderName = '';
123
-        if ( (bool) @$this->config->{"folder-name"} ) {
124
-            $folderName = $this->getClassName ( trim ( $this->config->{"folder-name"} ) );
123
+        if ((bool) @$this->config->{"folder-name"} ) {
124
+            $folderName = $this->getClassName(trim($this->config->{"folder-name"} ));
125 125
         }
126 126
 
127
-        if ( $this->config->hasSchemas () ) {
127
+        if ($this->config->hasSchemas()) {
128 128
 
129
-            $schemas = $this->config->getSchemas ();
130
-            foreach ( $schemas as $schema ) {
131
-                $arrUrl = array (
129
+            $schemas = $this->config->getSchemas();
130
+            foreach ($schemas as $schema) {
131
+                $arrUrl = array(
132 132
                     $this->baseLocation,
133 133
                     $driverBase,
134 134
                     $folderName,
135
-                    $this->getClassName ( $schema )
135
+                    $this->getClassName($schema)
136 136
                 );
137 137
 
138
-                $this->location[ $schema ] = $this->filterLocation ( $arrUrl );
139
-                unset( $arrUrl );
138
+                $this->location[$schema] = $this->filterLocation($arrUrl);
139
+                unset($arrUrl);
140 140
             }
141 141
 
142 142
         }
143 143
         else {
144
-            $url            = array (
144
+            $url = array(
145 145
                 $this->baseLocation,
146 146
                 $driverBase,
147 147
                 $folderName,
148
-                $this->getClassName (
149
-                    $this->getConfig ()
150
-                         ->getDatabase ()
148
+                $this->getClassName(
149
+                    $this->getConfig()
150
+                         ->getDatabase()
151 151
                 )
152 152
             );
153
-            $this->location = array ( $this->filterLocation ( $url ) );
154
-            unset( $url );
153
+            $this->location = array($this->filterLocation($url));
154
+            unset($url);
155 155
         }
156 156
     }
157 157
 
158 158
     /**
159 159
      * @return AdapterConfig\AbstractAdapter
160 160
      */
161
-    public function getConfig ()
161
+    public function getConfig()
162 162
     {
163 163
         return $this->config;
164 164
     }
165 165
 
166 166
     /* Get current time */
167
-    public function startTime ()
167
+    public function startTime()
168 168
     {
169 169
         echo "\033[1;32mStarting..\033[0m\n";
170
-        $this->startTime = microtime ( true );
170
+        $this->startTime = microtime(true);
171 171
     }
172 172
 
173
-    private function getRunTime ()
173
+    private function getRunTime()
174 174
     {
175
-        return round ( ( microtime ( true ) - $this->startTime ), 3 );
175
+        return round((microtime(true) - $this->startTime), 3);
176 176
     }
177 177
 
178 178
     /**
179 179
      * @param $objMakeFile
180 180
      */
181
-    private function generateFilesFixed ( FilesFixeds $objFilesFixeds )
181
+    private function generateFilesFixed(FilesFixeds $objFilesFixeds)
182 182
     {
183
-        if ( $objFilesFixeds->hasData() )
183
+        if ($objFilesFixeds->hasData())
184 184
         {
185 185
             $file = $this->baseLocation
186 186
                              . DIRECTORY_SEPARATOR
187 187
                              . $objFilesFixeds->getFileName()
188 188
                              . '.php';
189 189
 
190
-            $tpl = $this->getParsedTplContents ( $objFilesFixeds->getTpl() );
191
-            self::makeSourcer ( $file , $tpl , true );
190
+            $tpl = $this->getParsedTplContents($objFilesFixeds->getTpl());
191
+            self::makeSourcer($file, $tpl, true);
192 192
         }
193 193
     }
194 194
 
195 195
     /**
196 196
      * Executa o Make, criando arquivos e Diretorios
197 197
      */
198
-    public function run ()
198
+    public function run()
199 199
     {
200 200
         $cur             = 0;
201 201
         $numFilesCreated = 0;
202 202
         $numFilesIgnored = 0;
203 203
 
204
-        $this->startTime ();
204
+        $this->startTime();
205 205
         $this->waitOfDatabase($cur);
206 206
 
207
-        $this->max       = $this->driver->getTotalTables () * $this->countDiretory ();
207
+        $this->max = $this->driver->getTotalTables() * $this->countDiretory();
208 208
 
209
-        foreach ( $this->location as $schema => $location ) {
210
-            foreach ( $this->factoryMakerFile () as $objMakeFile ) {
211
-                $path = $location . DIRECTORY_SEPARATOR . $objMakeFile->getPastName ();
212
-                if($this->config->isCleanTrash()){
213
-                    CleanTrash::getInstance ()->run ( $path , $this->driver, $schema );
209
+        foreach ($this->location as $schema => $location) {
210
+            foreach ($this->factoryMakerFile() as $objMakeFile) {
211
+                $path = $location . DIRECTORY_SEPARATOR . $objMakeFile->getPastName();
212
+                if ($this->config->isCleanTrash()) {
213
+                    CleanTrash::getInstance()->run($path, $this->driver, $schema);
214 214
                 }
215
-                self::makeDir ( $path );
215
+                self::makeDir($path);
216 216
 
217 217
                 #Cria as Classes de Exceção e Abstratas
218
-                foreach ( $objMakeFile->getListFilesFixed () as $nameObject )
218
+                foreach ($objMakeFile->getListFilesFixed() as $nameObject)
219 219
                 {
220 220
                     $this->generateFilesFixed($objMakeFile->getFilesFixeds($nameObject));
221 221
                 }
222 222
 
223 223
                 #Cria as Classes do Banco
224
-                foreach ( $this->driver->getTables ( $schema ) as $key => $objTables ) {
225
-                    $file = $path . DIRECTORY_SEPARATOR . self::getClassName ( $objTables->getName () ) . '.php';
224
+                foreach ($this->driver->getTables($schema) as $key => $objTables) {
225
+                    $file = $path . DIRECTORY_SEPARATOR . self::getClassName($objTables->getName()) . '.php';
226 226
 
227
-                    $tpl = $this->getParsedTplContents (
228
-                        $objMakeFile->getFileTpl (),
229
-                        $objMakeFile->parseRelation ( $this, $objTables ),
227
+                    $tpl = $this->getParsedTplContents(
228
+                        $objMakeFile->getFileTpl(),
229
+                        $objMakeFile->parseRelation($this, $objTables),
230 230
                         $objTables,
231 231
                         $objMakeFile
232 232
 
233 233
                     );
234
-                    if ( self::makeSourcer ( $file, $tpl, $objMakeFile->isOverwrite () ) ) {
234
+                    if (self::makeSourcer($file, $tpl, $objMakeFile->isOverwrite())) {
235 235
                         ++$numFilesCreated;
236 236
                     }
237 237
                     else {
238 238
                         ++$numFilesIgnored;
239 239
                     }
240 240
 
241
-                    $this->countCreatedFiles ( $cur );
241
+                    $this->countCreatedFiles($cur);
242 242
                 }
243 243
             }
244 244
         }
245 245
 
246
-        $this->reportProcess ( $numFilesCreated, $numFilesIgnored );
246
+        $this->reportProcess($numFilesCreated, $numFilesIgnored);
247 247
         echo "\n\033[1;32mSuccessfully process finished!\n\033[0m";
248 248
     }
249 249
 
250
-    private function waitOfDatabase ( &$cur )
250
+    private function waitOfDatabase(&$cur)
251 251
     {
252
-        printf ( "\033[1;33mWait, the database is being analyzed..\033[0m\n" );
253
-        $this->driver->runDatabase ();
254
-        printf ( "\r Creating: \033[1;32m%6.2f%%\033[0m", $cur );
252
+        printf("\033[1;33mWait, the database is being analyzed..\033[0m\n");
253
+        $this->driver->runDatabase();
254
+        printf("\r Creating: \033[1;32m%6.2f%%\033[0m", $cur);
255 255
     }
256 256
 
257
-    private function countCreatedFiles ( &$cur )
257
+    private function countCreatedFiles(&$cur)
258 258
     {
259 259
         ++$cur;
260
-        $total = ( $cur / $this->max ) * 100;
261
-        printf ( "\r Creating: \033[1;32m%6.2f%%\033[0m", $total );
260
+        $total = ($cur / $this->max) * 100;
261
+        printf("\r Creating: \033[1;32m%6.2f%%\033[0m", $total);
262 262
     }
263 263
 
264
-    private function reportProcess ( $numFilesCreated = 0, $numFilesIgnored = 0 )
264
+    private function reportProcess($numFilesCreated = 0, $numFilesIgnored = 0)
265 265
     {
266
-        if ( $this->config->isStatusEnabled () ) {
267
-            $databases  = count ( $this->location );
268
-            $countDir   = $this->countDiretory ();
269
-            $totalTable = $this->driver->getTotalTables ();
266
+        if ($this->config->isStatusEnabled()) {
267
+            $databases  = count($this->location);
268
+            $countDir   = $this->countDiretory();
269
+            $totalTable = $this->driver->getTotalTables();
270 270
             $totalFiles = $numFilesIgnored + $numFilesCreated;
271
-            $totalFilesDeleted = CleanTrash::getInstance ()->getNumFilesDeleted();
271
+            $totalFilesDeleted = CleanTrash::getInstance()->getNumFilesDeleted();
272 272
             echo "\n------";
273
-            printf ( "\n\r-Files generated/updated: \033[1;33m%s\033[0m" , $numFilesCreated );
274
-            printf ( "\n\r-Files not upgradeable: \033[1;33m%s\033[0m" , $numFilesIgnored );
275
-            printf ( "\n\r-Files deleted: \033[1;33m%s\033[0m" , $totalFilesDeleted );
276
-            printf ( "\n\r-Total files analyzed: \033[1;33m%s of %s\033[0m" , $totalFiles , $this->max );
277
-            printf ( "\n\r-Diretories: \033[1;33m%s\033[0m" , $databases * $countDir );
278
-            printf ( "\n\r-Scanned tables: \033[1;33m%s\033[0m" , $totalTable );
279
-            printf ( "\n\r-Execution time: \033[1;33m%ssec\033[0m" , $this->getRunTime () );
273
+            printf("\n\r-Files generated/updated: \033[1;33m%s\033[0m", $numFilesCreated);
274
+            printf("\n\r-Files not upgradeable: \033[1;33m%s\033[0m", $numFilesIgnored);
275
+            printf("\n\r-Files deleted: \033[1;33m%s\033[0m", $totalFilesDeleted);
276
+            printf("\n\r-Total files analyzed: \033[1;33m%s of %s\033[0m", $totalFiles, $this->max);
277
+            printf("\n\r-Diretories: \033[1;33m%s\033[0m", $databases * $countDir);
278
+            printf("\n\r-Scanned tables: \033[1;33m%s\033[0m", $totalTable);
279
+            printf("\n\r-Execution time: \033[1;33m%ssec\033[0m", $this->getRunTime());
280 280
             echo "\n------";
281 281
         }
282 282
     }
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
      *
287 287
      * @return AbstractAdapter[]
288 288
      */
289
-    public function factoryMakerFile ()
289
+    public function factoryMakerFile()
290 290
     {
291
-        return $this->config->getMakeFileInstances ();
291
+        return $this->config->getMakeFileInstances();
292 292
     }
293 293
 
294 294
     /**
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
      *
297 297
      * @return int
298 298
      */
299
-    public function countDiretory ()
299
+    public function countDiretory()
300 300
     {
301
-        if ( null === $this->countDir ) {
301
+        if (null === $this->countDir) {
302 302
             $this->countDir = 1;
303
-            foreach ( $this->factoryMakerFile () as $abstractAdapter ) {
304
-                if ( $abstractAdapter->hasDiretory () ) {
303
+            foreach ($this->factoryMakerFile() as $abstractAdapter) {
304
+                if ($abstractAdapter->hasDiretory()) {
305 305
                     ++$this->countDir;
306 306
                 }
307 307
             }
@@ -318,24 +318,24 @@  discard block
 block discarded – undo
318 318
      *
319 319
      * @return String
320 320
      */
321
-    protected function getParsedTplContents ( $tplFile, $vars = array (), \Classes\Db\DbTable $objTables = null,
322
-                                              $objMakeFile = null )
321
+    protected function getParsedTplContents($tplFile, $vars = array(), \Classes\Db\DbTable $objTables = null,
322
+                                              $objMakeFile = null)
323 323
     {
324 324
 
325
-        $arrUrl = array (
325
+        $arrUrl = array(
326 326
             __DIR__,
327 327
             'templates',
328 328
             $this->config->framework,
329 329
             $tplFile
330 330
         );
331 331
 
332
-        $filePath = implode ( DIRECTORY_SEPARATOR, filter_var_array ( $arrUrl ) );
332
+        $filePath = implode(DIRECTORY_SEPARATOR, filter_var_array($arrUrl));
333 333
 
334
-        extract ( $vars );
335
-        ob_start ();
334
+        extract($vars);
335
+        ob_start();
336 336
         require $filePath;
337
-        $data = ob_get_contents ();
338
-        ob_end_clean ();
337
+        $data = ob_get_contents();
338
+        ob_end_clean();
339 339
 
340 340
         return $data;
341 341
     }
Please login to merge, or discard this patch.
build/Classes/templates/zf1/model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,20 +3,20 @@
 block discarded – undo
3 3
 /**
4 4
  * Data Entity implementation for this class
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8
- * @package <?=$objTables->getNamespace()."\n"?>
9
- * @see  <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?>. <?="\n"?>
8
+ * @package <?=$objTables->getNamespace() . "\n"?>
9
+ * @see  <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?>. <?="\n"?>
10 10
  *
11
- * @author    <?=$this->config->author."\n"?>
11
+ * @author    <?=$this->config->author . "\n"?>
12 12
  *
13
- * @copyright <?=$this->config->copyright."\n"?>
14
- * @license   <?=$this->config->license."\n"?>
15
- * @link      <?=$this->config->link."\n"?>
16
- * @version   <?=$this->config->version."\n"?>
13
+ * @copyright <?=$this->config->copyright . "\n"?>
14
+ * @license   <?=$this->config->license . "\n"?>
15
+ * @link      <?=$this->config->link . "\n"?>
16
+ * @version   <?=$this->config->version . "\n"?>
17 17
  */
18 18
 
19
-class <?=$objTables->getNamespace()?>_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?> extends <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () ). "\n"?>
19
+class <?=$objTables->getNamespace()?>_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?> extends <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName()) . "\n"?>
20 20
 {
21 21
        /* @TODO Codifique aqui */
22 22
 }
Please login to merge, or discard this patch.
build/phar-generate.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
     $arg = getopt ( null, $arrValid );
80 80
     if ( array_key_exists ( 'init', $arg ) ) {
81 81
         $maker = new \Classes\MakerConfigFile( $arg, $_path );
82
-    }
83
-    else {
82
+    } else {
84 83
         $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) );
85 84
     }
86 85
 
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! ini_get ( 'short_open_tag' ) )
3
+if ( ! ini_get('short_open_tag'))
4 4
 {
5
-    die( "\033[0;31mError: please enable short_open_tag directive in php.ini\033[0m\n" );
5
+    die("\033[0;31mError: please enable short_open_tag directive in php.ini\033[0m\n");
6 6
 }
7 7
 
8
-if ( ! ini_get ( 'register_argc_argv' ) )
8
+if ( ! ini_get('register_argc_argv'))
9 9
 {
10
-    die( "\033[0;31mError: please enable register_argc_argv directive in php.ini\033[0m\n" );
10
+    die("\033[0;31mError: please enable register_argc_argv directive in php.ini\033[0m\n");
11 11
 }
12 12
 
13
-if ( function_exists ( 'ini_set' ) ) {
14
-    @ini_set ( 'display_errors', 1 );
13
+if (function_exists('ini_set')) {
14
+    @ini_set('display_errors', 1);
15 15
 
16
-    $memoryInBytes = function ( $value ) {
17
-        $unit  = strtolower ( substr ( $value, -1, 1 ) );
16
+    $memoryInBytes = function($value) {
17
+        $unit  = strtolower(substr($value, -1, 1));
18 18
         $value = (int) $value;
19
-        switch ( $unit ) {
19
+        switch ($unit) {
20 20
             case 'g':
21 21
                 $value *= 1024;
22 22
             // no break (cumulative multiplier)
@@ -30,22 +30,22 @@  discard block
 block discarded – undo
30 30
         return $value;
31 31
     };
32 32
 
33
-    $memoryLimit = trim ( ini_get ( 'memory_limit' ) );
33
+    $memoryLimit = trim(ini_get('memory_limit'));
34 34
     // Increase memory_limit if it is lower than 1GB
35
-    if ( $memoryLimit != -1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) {
36
-        @ini_set ( 'memory_limit', '1G' );
35
+    if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) {
36
+        @ini_set('memory_limit', '1G');
37 37
     }
38
-    unset( $memoryInBytes, $memoryLimit );
38
+    unset($memoryInBytes, $memoryLimit);
39 39
 }
40 40
 
41
-\Phar::interceptFileFuncs ();
41
+\Phar::interceptFileFuncs();
42 42
 
43
-set_include_path (
44
-    implode (
43
+set_include_path(
44
+    implode(
45 45
         PATH_SEPARATOR,
46
-        array (
47
-            realpath ( __DIR__ ),
48
-            get_include_path (),
46
+        array(
47
+            realpath(__DIR__),
48
+            get_include_path(),
49 49
         )
50 50
     )
51 51
 );
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 require_once 'Classes/MakerConfigFile.php';
56 56
 
57 57
 try {
58
-    $_path = realpath (
59
-        str_replace (
58
+    $_path = realpath(
59
+        str_replace(
60 60
             'phar://',
61 61
             '',
62 62
             __DIR__
63 63
         )
64 64
     );
65 65
 
66
-    $arrValid = array (
66
+    $arrValid = array(
67 67
         'version',
68 68
         'help',
69 69
         'status',
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
         'clean-trash:'
80 80
     );
81 81
 
82
-    $arg = getopt ( null, $arrValid );
83
-    if ( array_key_exists ( 'init', $arg ) ) {
84
-        $maker = new \Classes\MakerConfigFile( $arg, dirname($_path) );
82
+    $arg = getopt(null, $arrValid);
83
+    if (array_key_exists('init', $arg)) {
84
+        $maker = new \Classes\MakerConfigFile($arg, dirname($_path));
85 85
     }
86 86
     else {
87
-        $maker = new \Classes\MakerFile( new \Classes\Config( $arg, dirname($_path), count ( $argv ) ) );
87
+        $maker = new \Classes\MakerFile(new \Classes\Config($arg, dirname($_path), count($argv)));
88 88
     }
89 89
 
90
-    $maker->run ();
90
+    $maker->run();
91 91
 
92
-} catch ( \Exception $e ) {
93
-    die( $e->getMessage () );
92
+} catch (\Exception $e) {
93
+    die($e->getMessage());
94 94
 }
95 95
 
96 96
 __halt_compiler();
97 97
\ No newline at end of file
Please login to merge, or discard this patch.
build/Classes/CleanTrash.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -34,6 +34,9 @@
 block discarded – undo
34 34
         return self::$instance;
35 35
     }
36 36
 
37
+    /**
38
+     * @param string $directory
39
+     */
37 40
     private function scanDir ( $directory )
38 41
     {
39 42
         if(!is_dir($directory)){
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
     /**
18 18
      * @type int
19 19
      */
20
-    private $countFileDeleted=0;
20
+    private $countFileDeleted = 0;
21 21
 
22
-    final private function __construct (){ }
22
+    final private function __construct() { }
23 23
 
24 24
     /**
25 25
      * @return \Classes\CleanTrash
26 26
      */
27
-    public static function getInstance ()
27
+    public static function getInstance()
28 28
     {
29
-        if ( self::$instance === null )
29
+        if (self::$instance === null)
30 30
         {
31 31
             self::$instance = new self();
32 32
         }
@@ -34,20 +34,20 @@  discard block
 block discarded – undo
34 34
         return self::$instance;
35 35
     }
36 36
 
37
-    private function scanDir ( $directory )
37
+    private function scanDir($directory)
38 38
     {
39
-        if(!is_dir($directory)){
39
+        if ( ! is_dir($directory)) {
40 40
             return array();
41 41
         }
42 42
 
43
-        $diretories = preg_grep ( '*\.ph*' , scandir ( $directory ) );
44
-        if(!$diretories){
43
+        $diretories = preg_grep('*\.ph*', scandir($directory));
44
+        if ( ! $diretories) {
45 45
             return array();
46 46
         }
47 47
 
48
-        return array_diff ( $diretories, array (
49
-            '..' , '.'
50
-        ) );
48
+        return array_diff($diretories, array(
49
+            '..', '.'
50
+        ));
51 51
     }
52 52
 
53 53
     /**
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return array
59 59
      */
60
-    private function diffFiles ( $path , $driver , $schema = 0 )
60
+    private function diffFiles($path, $driver, $schema = 0)
61 61
     {
62
-        $tables = $driver->getTables ( $schema );
63
-        if(!$tables instanceof DbTables){
62
+        $tables = $driver->getTables($schema);
63
+        if ( ! $tables instanceof DbTables) {
64 64
             return array();
65 65
         }
66 66
         $tablesName = $tables->toArrayFileName();
67
-        return array_diff ( $this->scanDir ( $path ) , $tablesName );
67
+        return array_diff($this->scanDir($path), $tablesName);
68 68
     }
69 69
 
70 70
     /**
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return int
76 76
      */
77
-    public function run ( $path , $driver , $schema = 0 )
77
+    public function run($path, $driver, $schema = 0)
78 78
     {
79 79
         $count = 0;
80
-        foreach ( $this->diffFiles ( $path , $driver , $schema ) as $fileDel )
80
+        foreach ($this->diffFiles($path, $driver, $schema) as $fileDel)
81 81
         {
82
-            if ( unlink ( $path . DIRECTORY_SEPARATOR . $fileDel ) )
82
+            if (unlink($path . DIRECTORY_SEPARATOR . $fileDel))
83 83
             {
84
-                ++ $count;
84
+                ++$count;
85 85
             }
86 86
         }
87 87
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      * @return int
95 95
      */
96
-    public function getNumFilesDeleted ()
96
+    public function getNumFilesDeleted()
97 97
     {
98 98
         return $this->countFileDeleted;
99 99
     }
Please login to merge, or discard this patch.
build/Classes/Maker/AbstractMaker.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
      *
11 11
      * @param $dir
12 12
      */
13
-    public static function makeDir ( $dir )
13
+    public static function makeDir($dir)
14 14
     {
15
-        if ( !is_dir ( $dir ) )
15
+        if ( ! is_dir($dir))
16 16
         {
17
-            if ( !@mkdir ( $dir, 0755, true ) )
17
+            if ( ! @mkdir($dir, 0755, true))
18 18
             {
19
-                die( "\033[0;31mError: could not create directory $dir\033[0m\n" );
19
+                die("\033[0;31mError: could not create directory $dir\033[0m\n");
20 20
             }
21 21
         }
22 22
     }
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return boolean
30 30
      */
31
-    public static function makeSourcer ( $nameFile, $tplContent, $overwrite = false )
31
+    public static function makeSourcer($nameFile, $tplContent, $overwrite = false)
32 32
     {
33
-        if ( !$overwrite && is_file ( $nameFile ) )
33
+        if ( ! $overwrite && is_file($nameFile))
34 34
         {
35 35
             return false;
36 36
         }
37 37
 
38
-        if ( !file_put_contents ( $nameFile, $tplContent ) )
38
+        if ( ! file_put_contents($nameFile, $tplContent))
39 39
         {
40
-            die( "\033[0;31mError: could not write model file $nameFile.\033[0m\n" );
40
+            die("\033[0;31mError: could not write model file $nameFile.\033[0m\n");
41 41
         }
42 42
 
43 43
         return true;
@@ -48,24 +48,24 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return string
50 50
      */
51
-    public static function getClassName ( $str )
51
+    public static function getClassName($str)
52 52
     {
53 53
         $temp = '';
54
-        foreach ( explode ( self::SEPARETOR, $str ) as $part )
54
+        foreach (explode(self::SEPARETOR, $str) as $part)
55 55
         {
56
-            $temp .= ucfirst ( $part );
56
+            $temp .= ucfirst($part);
57 57
         }
58 58
 
59 59
         return $temp;
60 60
     }
61 61
 
62
-    protected function getParsedTplContents ( $filePath, $vars = array () )
62
+    protected function getParsedTplContents($filePath, $vars = array())
63 63
     {
64
-        extract ( $vars );
65
-        ob_start ();
64
+        extract($vars);
65
+        ob_start();
66 66
         require $filePath;
67
-        $data = ob_get_contents ();
68
-        ob_end_clean ();
67
+        $data = ob_get_contents();
68
+        ob_end_clean();
69 69
 
70 70
         return $data;
71 71
     }
Please login to merge, or discard this patch.