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 ( 660260...e1c224 )
by Pedro
03:36
created
build/Classes/AdaptersDriver/AbsractAdapter.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -107,31 +107,31 @@  discard block
 block discarded – undo
107 107
             if ( $table->hasColumn ( $constrant[ "column_name" ] ) )
108 108
             {
109 109
                 $objConstrant = Constrant::getInstance ()
110
-                                         ->populate (
111
-                                             array (
112
-                                                 'constrant' => $constrant[ 'constraint_name' ] ,
113
-                                                 'schema'    => $constrant[ 'foreign_schema' ] ,
114
-                                                 'table'     => $constrant[ 'foreign_table' ] ,
115
-                                                 'column'    => $constrant[ 'foreign_column' ]
116
-                                             )
117
-                                         );
110
+                                            ->populate (
111
+                                                array (
112
+                                                    'constrant' => $constrant[ 'constraint_name' ] ,
113
+                                                    'schema'    => $constrant[ 'foreign_schema' ] ,
114
+                                                    'table'     => $constrant[ 'foreign_table' ] ,
115
+                                                    'column'    => $constrant[ 'foreign_column' ]
116
+                                                )
117
+                                            );
118 118
 
119 119
                 switch ( $constrant[ 'constraint_type' ] )
120 120
                 {
121 121
                     case "FOREIGN KEY":
122 122
                         $table->getColumn ( $constrant[ "column_name" ] )
123
-                              ->addRefFk ( $objConstrant );
123
+                                ->addRefFk ( $objConstrant );
124 124
                         break;
125 125
                     case"PRIMARY KEY":
126 126
                         $table->getColumn ( $constrant[ "column_name" ] )
127
-                              ->setPrimaryKey ( $objConstrant )
128
-                              ->setSequence (
129
-                                  $this->getSequence (
130
-                                      $table_name ,
131
-                                      $constrant[ "column_name" ],
132
-                                      $schema
133
-                                  )
134
-                              );
127
+                                ->setPrimaryKey ( $objConstrant )
128
+                                ->setSequence (
129
+                                    $this->getSequence (
130
+                                        $table_name ,
131
+                                        $constrant[ "column_name" ],
132
+                                        $schema
133
+                                    )
134
+                                );
135 135
                         break;
136 136
                 }
137 137
             }
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
             if ( $table->hasColumn ( $constrant[ "foreign_column" ] ) )
152 152
             {
153 153
                 $table->getColumn ( $constrant[ "foreign_column" ] )
154
-                      ->createDependece (
155
-                          $constrant[ 'constraint_name' ] ,
156
-                          $constrant[ 'table_name' ] ,
157
-                          $constrant[ 'column_name' ] ,
158
-                          $constrant[ 'table_schema' ]
159
-                      );
154
+                        ->createDependece (
155
+                            $constrant[ 'constraint_name' ] ,
156
+                            $constrant[ 'table_name' ] ,
157
+                            $constrant[ 'column_name' ] ,
158
+                            $constrant[ 'table_schema' ]
159
+                        );
160 160
             }
161 161
         }
162 162
     }
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
                             );
192 192
 
193 193
             $this->getTable ( $key , $schema )
194
-                 ->addColumn ( $column )
195
-                 ->setNamespace (
196
-                     $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
197
-                 );
194
+                    ->addColumn ( $column )
195
+                    ->setNamespace (
196
+                        $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
197
+                    );
198 198
         }
199 199
     }
200 200
 
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
     public function createTable ( $nameTable , $schema = 0 )
255 255
     {
256 256
         $this->objDbTables[ $schema ][ trim ( $nameTable ) ] = DbTable::getInstance ()
257
-                                                                      ->populate (
258
-                                                                          array (
259
-                                                                              'table'    => $nameTable ,
260
-                                                                              'schema'   => $schema ,
261
-                                                                              'database' => $this->database
262
-                                                                          )
263
-                                                                      );
257
+                                                                        ->populate (
258
+                                                                            array (
259
+                                                                                'table'    => $nameTable ,
260
+                                                                                'schema'   => $schema ,
261
+                                                                                'database' => $this->database
262
+                                                                            )
263
+                                                                        );
264 264
 
265 265
         return $this;
266 266
     }
Please login to merge, or discard this patch.
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     /**
60 60
      * @type \Classes\Db\DbTable[][]
61 61
      */
62
-    private $objDbTables = array ();
62
+    private $objDbTables = array();
63 63
 
64 64
     /**
65 65
      * @var AbstractAdapter
@@ -74,22 +74,22 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * analisa e popula as Foreing keys, Primary keys e dependencias do banco nos objetos
76 76
      */
77
-    protected function parseConstrants ()
77
+    protected function parseConstrants()
78 78
     {
79
-        foreach ( $this->getListConstrant () as $constrant )
79
+        foreach ($this->getListConstrant() as $constrant)
80 80
         {
81 81
 
82
-            $schema = $constrant[ 'table_schema' ];
83
-            $table_name = $constrant [ 'table_name' ];
84
-            $this->populateForeignAndPrimaryKeys ( $constrant , $table_name , $schema );
85
-            unset( $table_name , $schema );
82
+            $schema = $constrant['table_schema'];
83
+            $table_name = $constrant ['table_name'];
84
+            $this->populateForeignAndPrimaryKeys($constrant, $table_name, $schema);
85
+            unset($table_name, $schema);
86 86
 
87
-            if ( $constrant[ 'constraint_type' ] == "FOREIGN KEY" )
87
+            if ($constrant['constraint_type'] == "FOREIGN KEY")
88 88
             {
89
-                $schema = $constrant[ 'foreign_schema' ];
90
-                $table_name = $constrant [ 'foreign_table' ];
91
-                $this->populateDependece ( $constrant , $table_name , $schema );
92
-                unset( $table_name , $schema );
89
+                $schema = $constrant['foreign_schema'];
90
+                $table_name = $constrant ['foreign_table'];
91
+                $this->populateDependece($constrant, $table_name, $schema);
92
+                unset($table_name, $schema);
93 93
             }
94 94
         }
95 95
     }
@@ -99,36 +99,36 @@  discard block
 block discarded – undo
99 99
      * @param string $table_name
100 100
      * @param int    $schema
101 101
      */
102
-    private function populateForeignAndPrimaryKeys ( $constrant , $table_name , $schema = 0 )
102
+    private function populateForeignAndPrimaryKeys($constrant, $table_name, $schema = 0)
103 103
     {
104
-        if ( $this->hasTable ( $table_name , $schema ) )
104
+        if ($this->hasTable($table_name, $schema))
105 105
         {
106
-            $table = $this->getTable ( $table_name , $schema );
107
-            if ( $table->hasColumn ( $constrant[ "column_name" ] ) )
106
+            $table = $this->getTable($table_name, $schema);
107
+            if ($table->hasColumn($constrant["column_name"]))
108 108
             {
109
-                $objConstrant = Constrant::getInstance ()
110
-                                         ->populate (
111
-                                             array (
112
-                                                 'constrant' => $constrant[ 'constraint_name' ] ,
113
-                                                 'schema'    => $constrant[ 'foreign_schema' ] ,
114
-                                                 'table'     => $constrant[ 'foreign_table' ] ,
115
-                                                 'column'    => $constrant[ 'foreign_column' ]
109
+                $objConstrant = Constrant::getInstance()
110
+                                         ->populate(
111
+                                             array(
112
+                                                 'constrant' => $constrant['constraint_name'],
113
+                                                 'schema'    => $constrant['foreign_schema'],
114
+                                                 'table'     => $constrant['foreign_table'],
115
+                                                 'column'    => $constrant['foreign_column']
116 116
                                              )
117 117
                                          );
118 118
 
119
-                switch ( $constrant[ 'constraint_type' ] )
119
+                switch ($constrant['constraint_type'])
120 120
                 {
121 121
                     case "FOREIGN KEY":
122
-                        $table->getColumn ( $constrant[ "column_name" ] )
123
-                              ->addRefFk ( $objConstrant );
122
+                        $table->getColumn($constrant["column_name"])
123
+                              ->addRefFk($objConstrant);
124 124
                         break;
125 125
                     case"PRIMARY KEY":
126
-                        $table->getColumn ( $constrant[ "column_name" ] )
127
-                              ->setPrimaryKey ( $objConstrant )
128
-                              ->setSequence (
129
-                                  $this->getSequence (
130
-                                      $table_name ,
131
-                                      $constrant[ "column_name" ],
126
+                        $table->getColumn($constrant["column_name"])
127
+                              ->setPrimaryKey($objConstrant)
128
+                              ->setSequence(
129
+                                  $this->getSequence(
130
+                                      $table_name,
131
+                                      $constrant["column_name"],
132 132
                                       $schema
133 133
                                   )
134 134
                               );
@@ -143,19 +143,19 @@  discard block
 block discarded – undo
143 143
      * @param string $table_name
144 144
      * @param int    $schema
145 145
      */
146
-    private function populateDependece ( $constrant , $table_name , $schema = 0 )
146
+    private function populateDependece($constrant, $table_name, $schema = 0)
147 147
     {
148
-        if ( $this->hasTable ( $table_name , $schema ) )
148
+        if ($this->hasTable($table_name, $schema))
149 149
         {
150
-            $table = $this->getTable ( $table_name , $schema );
151
-            if ( $table->hasColumn ( $constrant[ "foreign_column" ] ) )
150
+            $table = $this->getTable($table_name, $schema);
151
+            if ($table->hasColumn($constrant["foreign_column"]))
152 152
             {
153
-                $table->getColumn ( $constrant[ "foreign_column" ] )
154
-                      ->createDependece (
155
-                          $constrant[ 'constraint_name' ] ,
156
-                          $constrant[ 'table_name' ] ,
157
-                          $constrant[ 'column_name' ] ,
158
-                          $constrant[ 'table_schema' ]
153
+                $table->getColumn($constrant["foreign_column"])
154
+                      ->createDependece(
155
+                          $constrant['constraint_name'],
156
+                          $constrant['table_name'],
157
+                          $constrant['column_name'],
158
+                          $constrant['table_schema']
159 159
                       );
160 160
             }
161 161
         }
@@ -164,36 +164,36 @@  discard block
 block discarded – undo
164 164
     /**
165 165
      * cria um Array com nome das tabelas
166 166
      */
167
-    public function parseTables ()
167
+    public function parseTables()
168 168
     {
169
-        if ( $this->hasTables () )
169
+        if ($this->hasTables())
170 170
         {
171
-            return $this->getAllTables ();
171
+            return $this->getAllTables();
172 172
         }
173 173
 
174
-        foreach ( $this->getListColumns () as $table )
174
+        foreach ($this->getListColumns() as $table)
175 175
         {
176
-            $schema = $table[ 'table_schema' ];
177
-            $key = $table [ 'table_name' ];
178
-            if ( ! $this->hasTable ( $key , $schema ) )
176
+            $schema = $table['table_schema'];
177
+            $key = $table ['table_name'];
178
+            if ( ! $this->hasTable($key, $schema))
179 179
             {
180
-                $this->createTable ( $key , $schema );
180
+                $this->createTable($key, $schema);
181 181
             }
182 182
 
183
-            $column = Column::getInstance ()
184
-                            ->populate (
185
-                                array (
186
-                                    'name'       => $table [ 'column_name' ] ,
187
-                                    'type'       => $this->convertTypeToPhp ( $table[ 'data_type' ] ) ,
188
-                                    'nullable'   => ( $table[ 'is_nullable' ] == 'YES' ) ,
189
-                                    'max_length' => $table[ 'max_length' ]
183
+            $column = Column::getInstance()
184
+                            ->populate(
185
+                                array(
186
+                                    'name'       => $table ['column_name'],
187
+                                    'type'       => $this->convertTypeToPhp($table['data_type']),
188
+                                    'nullable'   => ($table['is_nullable'] == 'YES'),
189
+                                    'max_length' => $table['max_length']
190 190
                                 )
191 191
                             );
192 192
 
193
-            $this->getTable ( $key , $schema )
194
-                 ->addColumn ( $column )
195
-                 ->setNamespace (
196
-                     $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) )
193
+            $this->getTable($key, $schema)
194
+                 ->addColumn($column)
195
+                 ->setNamespace(
196
+                     $this->config->createClassNamespace($this->getTable($key, $schema))
197 197
                  );
198 198
         }
199 199
     }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      *
204 204
      * @return int
205 205
      */
206
-    abstract public function getTotalTables ();
206
+    abstract public function getTotalTables();
207 207
 
208 208
     /**
209 209
      * Retorna o Nome da Sequence da tabela
@@ -213,23 +213,23 @@  discard block
 block discarded – undo
213 213
      *
214 214
      * @return string
215 215
      */
216
-    abstract public function getSequence ( $table , $column,  $schema=0 );
216
+    abstract public function getSequence($table, $column, $schema = 0);
217 217
 
218 218
     /**
219 219
      * @return array
220 220
      */
221
-    abstract public function getListConstrant ();
221
+    abstract public function getListConstrant();
222 222
 
223 223
     /**
224 224
      * @param string $str
225 225
      *
226 226
      * @return string
227 227
      */
228
-    protected function convertTypeToPhp ( $str )
228
+    protected function convertTypeToPhp($str)
229 229
     {
230
-        if ( isset( $this->dataTypes[ $str ] ) )
230
+        if (isset($this->dataTypes[$str]))
231 231
         {
232
-            return $this->dataTypes[ $str ];
232
+            return $this->dataTypes[$str];
233 233
         }
234 234
 
235 235
         return 'string';
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
     /**
239 239
      * @return string
240 240
      */
241
-    abstract public function getPDOString ();
241
+    abstract public function getPDOString();
242 242
 
243 243
     /**
244 244
      * @return string
245 245
      */
246
-    abstract public function getPDOSocketString ();
246
+    abstract public function getPDOSocketString();
247 247
 
248 248
     /**
249 249
      * @param     $nameTable
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
      *
252 252
      * @return \Classes\Db\DbTable
253 253
      */
254
-    public function createTable ( $nameTable , $schema = 0 )
254
+    public function createTable($nameTable, $schema = 0)
255 255
     {
256
-        $this->objDbTables[ $schema ][ trim ( $nameTable ) ] = DbTable::getInstance ()
257
-                                                                      ->populate (
258
-                                                                          array (
259
-                                                                              'table'    => $nameTable ,
260
-                                                                              'schema'   => $schema ,
256
+        $this->objDbTables[$schema][trim($nameTable)] = DbTable::getInstance()
257
+                                                                      ->populate(
258
+                                                                          array(
259
+                                                                              'table'    => $nameTable,
260
+                                                                              'schema'   => $schema,
261 261
                                                                               'database' => $this->database
262 262
                                                                           )
263 263
                                                                       );
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
      *
271 271
      * @return \Classes\Db\DbTable[]
272 272
      */
273
-    public function getTables ( $schema = 0 )
273
+    public function getTables($schema = 0)
274 274
     {
275
-        if ( ! isset( $this->objDbTables[ $schema ] ) )
275
+        if ( ! isset($this->objDbTables[$schema]))
276 276
         {
277
-            return array ();
277
+            return array();
278 278
         }
279 279
 
280
-        return $this->objDbTables[ $schema ];
280
+        return $this->objDbTables[$schema];
281 281
     }
282 282
 
283
-    public function getAllTables ()
283
+    public function getAllTables()
284 284
     {
285 285
         return $this->objDbTables;
286 286
     }
287 287
 
288
-    public function hasTables ()
288
+    public function hasTables()
289 289
     {
290
-        return ! empty( $this->objDbTables );
290
+        return ! empty($this->objDbTables);
291 291
     }
292 292
 
293 293
     /**
@@ -297,9 +297,9 @@  discard block
 block discarded – undo
297 297
      *
298 298
      * @return \Classes\Db\DbTable
299 299
      */
300
-    public function getTable ( $nameTable , $schema = 0 )
300
+    public function getTable($nameTable, $schema = 0)
301 301
     {
302
-        return $this->objDbTables[ $schema ][ trim ( $nameTable ) ];
302
+        return $this->objDbTables[$schema][trim($nameTable)];
303 303
     }
304 304
 
305 305
     /**
@@ -308,9 +308,9 @@  discard block
 block discarded – undo
308 308
      *
309 309
      * @return bool
310 310
      */
311
-    public function hasTable ( $nameTable , $schema = 0 )
311
+    public function hasTable($nameTable, $schema = 0)
312 312
     {
313
-        return isset( $this->objDbTables[ $schema ][ trim ( $nameTable ) ] );
313
+        return isset($this->objDbTables[$schema][trim($nameTable)]);
314 314
     }
315 315
 
316 316
     /**
@@ -318,64 +318,64 @@  discard block
 block discarded – undo
318 318
      *
319 319
      * @return array[]
320 320
      */
321
-    abstract public function getListColumns ();
321
+    abstract public function getListColumns();
322 322
 
323 323
     /**
324 324
      * Retorna um Array com nome das tabelas
325 325
      *
326 326
      * @return string[]
327 327
      */
328
-    abstract public function getListNameTable ();
328
+    abstract public function getListNameTable();
329 329
 
330 330
     /**
331 331
      * @param \Classes\AdapterConfig\AbstractAdapter $adapterConfig
332 332
      */
333
-    public function __construct ( AbstractAdapter $adapterConfig )
333
+    public function __construct(AbstractAdapter $adapterConfig)
334 334
     {
335 335
         $this->config = $adapterConfig;
336
-        $this->host = $adapterConfig->getHost ();
337
-        $this->database = $adapterConfig->getDatabase ();
338
-        $this->port = $adapterConfig->hasPort () ? $adapterConfig->getPort ()
336
+        $this->host = $adapterConfig->getHost();
337
+        $this->database = $adapterConfig->getDatabase();
338
+        $this->port = $adapterConfig->hasPort() ? $adapterConfig->getPort()
339 339
             : $this->port;
340
-        $this->username = $adapterConfig->getUser ();
341
-        $this->password = $adapterConfig->getPassword ();
342
-        $this->socket = $adapterConfig->getSocket ();
340
+        $this->username = $adapterConfig->getUser();
341
+        $this->password = $adapterConfig->getPassword();
342
+        $this->socket = $adapterConfig->getSocket();
343 343
 
344 344
     }
345 345
 
346 346
     /**
347 347
      * Executa as consultas do banco de dados
348 348
      */
349
-    public function runDatabase ()
349
+    public function runDatabase()
350 350
     {
351
-        $this->parseTables ();
352
-        $this->parseConstrants ();
351
+        $this->parseTables();
352
+        $this->parseConstrants();
353 353
     }
354 354
 
355 355
     /**
356 356
      *
357 357
      * @return \PDO
358 358
      */
359
-    public function getPDO ()
359
+    public function getPDO()
360 360
     {
361
-        if ( is_null ( $this->_pdo ) )
361
+        if (is_null($this->_pdo))
362 362
         {
363
-            if ( ! empty( $this->socket ) )
363
+            if ( ! empty($this->socket))
364 364
             {
365
-                $pdoString = $this->getPDOSocketString ();
365
+                $pdoString = $this->getPDOSocketString();
366 366
             } else
367 367
             {
368
-                $pdoString = $this->getPDOString ();
368
+                $pdoString = $this->getPDOString();
369 369
             }
370 370
 
371 371
             try
372 372
             {
373
-                $this->_pdo = new \PDO (
374
-                    $pdoString , $this->username , $this->password
373
+                $this->_pdo = new \PDO(
374
+                    $pdoString, $this->username, $this->password
375 375
                 );
376
-            } catch ( \Exception $e )
376
+            } catch (\Exception $e)
377 377
             {
378
-                die ( "pdo error: " . $e->getMessage () . "\n" );
378
+                die ("pdo error: " . $e->getMessage() . "\n");
379 379
             }
380 380
         }
381 381
 
Please login to merge, or discard this patch.
build/Classes/AdaptersDriver/Mssql.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      *
71 71
      * @return array[]
72 72
      */
73
-    public function getListColumns ()
73
+    public function getListColumns()
74 74
     {
75 75
         // TODO: Implement getListColumns() method.
76 76
     }
@@ -80,17 +80,17 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return int
82 82
      */
83
-    public function getTotalTables ()
83
+    public function getTotalTables()
84 84
     {
85 85
         // TODO: Implement totalTables() method.
86 86
     }
87 87
 
88
-    public function getSequence ( $table , $column, $schema=0 )
88
+    public function getSequence($table, $column, $schema = 0)
89 89
     {
90 90
         // TODO: Implement getSequence() method.
91 91
     }
92 92
 
93
-    public function getListConstrant ()
93
+    public function getListConstrant()
94 94
     {
95 95
         // TODO: Implement getListConstrant() method.
96 96
     }
Please login to merge, or discard this patch.
build/Classes/AdaptersDriver/Mysql.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return string
32 32
      */
33
-    protected function convertTypeToPhp ( $str )
33
+    protected function convertTypeToPhp($str)
34 34
     {
35 35
         $res = '';
36
-        if ( preg_match ( '/(tinyint\(1\)|bit)/' , $str ) )
36
+        if (preg_match('/(tinyint\(1\)|bit)/', $str))
37 37
         {
38 38
             $res = 'boolean';
39
-        } elseif ( preg_match ( '/(datetime|timestamp|blob|char|enum|text|date)/' , $str ) )
39
+        } elseif (preg_match('/(datetime|timestamp|blob|char|enum|text|date)/', $str))
40 40
         {
41 41
             $res = 'string';
42
-        } elseif ( preg_match ( '/(decimal|numeric|float|double)/' , $str ) )
42
+        } elseif (preg_match('/(decimal|numeric|float|double)/', $str))
43 43
         {
44 44
             $res = 'float';
45
-        } elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#' , $str , $matches ) )
45
+        } elseif (preg_match('#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches))
46 46
         {
47
-            $res = $matches[ 1 ];
47
+            $res = $matches[1];
48 48
         } else
49 49
         {
50 50
             print "Can't convert column type to PHP - Unrecognized type: $str";
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
      * @inheritDoc
58 58
      * @return string
59 59
      */
60
-    public function getPDOString ()
60
+    public function getPDOString()
61 61
     {
62
-        return sprintf (
63
-            "mysql:host=%s;port=%s;dbname=%s" ,
64
-            $this->host ,
65
-            $this->port ,
62
+        return sprintf(
63
+            "mysql:host=%s;port=%s;dbname=%s",
64
+            $this->host,
65
+            $this->port,
66 66
             $this->database
67 67
 
68 68
         );
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
      * @inheritDoc
73 73
      * @return string
74 74
      */
75
-    public function getPDOSocketString ()
75
+    public function getPDOSocketString()
76 76
     {
77
-        return sprintf (
78
-            "mysql:unix_socket=%s;dbname=%s" ,
79
-            $this->socket ,
77
+        return sprintf(
78
+            "mysql:unix_socket=%s;dbname=%s",
79
+            $this->socket,
80 80
             $this->database
81 81
 
82 82
         );
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
      * @inheritDoc
87 87
      * @return string[]
88 88
      */
89
-    public function getListNameTable ()
89
+    public function getListNameTable()
90 90
     {
91
-        if ( empty( $this->tableList ) )
91
+        if (empty($this->tableList))
92 92
         {
93
-            $this->tableList = $this->getPDO ()->query (
93
+            $this->tableList = $this->getPDO()->query(
94 94
                 "show tables"
95
-            )->fetchAll ();
95
+            )->fetchAll();
96 96
         }
97 97
 
98 98
         return $this->tableList;
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return array[]
105 105
      */
106
-    public function getListColumns ()
106
+    public function getListColumns()
107 107
     {
108 108
 
109
-        return $this->getPDO ()->query (
109
+        return $this->getPDO()->query(
110 110
             "select
111 111
                 0 AS table_schema,
112 112
                 table_name,
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
             from information_schema.columns
118 118
             where table_schema IN ('{$this->database}')
119 119
             order by table_name,ordinal_position"
120
-        )->fetchAll ( \PDO::FETCH_ASSOC );
120
+        )->fetchAll(\PDO::FETCH_ASSOC);
121 121
     }
122 122
 
123 123
     /**
124 124
      * @return array
125 125
      */
126
-    public function getListConstrant ()
126
+    public function getListConstrant()
127 127
     {
128
-        return $this->getPDO ()->query (
128
+        return $this->getPDO()->query(
129 129
             "SELECT distinct
130 130
      i.constraint_type,
131 131
      k.constraint_name,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 WHERE
143 143
 i.TABLE_SCHEMA IN ('{$this->database}') AND i.CONSTRAINT_TYPE IN ('FOREIGN KEY', 'PRIMARY KEY' )
144 144
 order by k.table_schema, k.table_name;"
145
-        )->fetchAll ( \PDO::FETCH_ASSOC );
145
+        )->fetchAll(\PDO::FETCH_ASSOC);
146 146
     }
147 147
 
148 148
     /**
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
      *
151 151
      * @return int
152 152
      */
153
-    public function getTotalTables ()
153
+    public function getTotalTables()
154 154
     {
155
-        if ( empty( $this->totalTables ) )
155
+        if (empty($this->totalTables))
156 156
         {
157 157
 
158
-            $this->totalTables = $this->getPDO ()->query (
158
+            $this->totalTables = $this->getPDO()->query(
159 159
                 "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{$this->database}'"
160
-            )->fetchColumn ();
160
+            )->fetchColumn();
161 161
         }
162 162
 
163 163
         return (int) $this->totalTables;
@@ -171,13 +171,13 @@  discard block
 block discarded – undo
171 171
      *
172 172
      * @return string
173 173
      */
174
-    public function getSequence ( $table , $column, $schema=0 )
174
+    public function getSequence($table, $column, $schema = 0)
175 175
     {
176
-        $return = $this->getPDO ()
177
-                       ->query ( "select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';" )
178
-                       ->fetch ( \PDO::FETCH_ASSOC );
176
+        $return = $this->getPDO()
177
+                       ->query("select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';")
178
+                       ->fetch(\PDO::FETCH_ASSOC);
179 179
 
180
-        if ( ! $return )
180
+        if ( ! $return)
181 181
         {
182 182
             return;
183 183
         }
Please login to merge, or discard this patch.
build/Classes/AdaptersDriver/Pgsql.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -27,43 +27,43 @@  discard block
 block discarded – undo
27 27
     /**
28 28
      * @type array|\string[]
29 29
      */
30
-    protected $schema = array ( 'public' );
30
+    protected $schema = array('public');
31 31
 
32
-    protected $dataTypes = array (
32
+    protected $dataTypes = array(
33 33
         /* Numeric Types */
34
-        'smallint'         => 'int' ,
35
-        'integer'          => 'int' ,
36
-        'bigint'           => 'float' ,
37
-        'decimal'          => 'float' ,
38
-        'numeric'          => 'float' ,
39
-        'real'             => 'float' ,
40
-        'double precision' => 'float' ,
41
-        'serial'           => 'int' ,
42
-        'bigserial'        => 'float' ,
34
+        'smallint'         => 'int',
35
+        'integer'          => 'int',
36
+        'bigint'           => 'float',
37
+        'decimal'          => 'float',
38
+        'numeric'          => 'float',
39
+        'real'             => 'float',
40
+        'double precision' => 'float',
41
+        'serial'           => 'int',
42
+        'bigserial'        => 'float',
43 43
         /* Monetary Types */
44
-        'money'            => 'float' ,
44
+        'money'            => 'float',
45 45
         /* Character Types */
46
-        'character varyin' => 'string' ,
47
-        'varchar'          => 'string' ,
48
-        'character'        => 'string' ,
49
-        'char'             => 'string' ,
50
-        'text'             => 'string' ,
46
+        'character varyin' => 'string',
47
+        'varchar'          => 'string',
48
+        'character'        => 'string',
49
+        'char'             => 'string',
50
+        'text'             => 'string',
51 51
         /* Binary Data Types */
52
-        'bytea'            => 'string' ,
52
+        'bytea'            => 'string',
53 53
         /* Date/Time Types */
54
-        'datatime'         => 'date' ,
55
-        'date'             => 'date' ,
54
+        'datatime'         => 'date',
55
+        'date'             => 'date',
56 56
 
57 57
         /* Boolean Type */
58 58
         'boolean'          => 'boolean'
59 59
     );
60 60
 
61
-    public function __construct ( AbstractAdapter $adapterConfig )
61
+    public function __construct(AbstractAdapter $adapterConfig)
62 62
     {
63
-        parent::__construct ( $adapterConfig );
64
-        if ( $adapterConfig->hasSchemas () )
63
+        parent::__construct($adapterConfig);
64
+        if ($adapterConfig->hasSchemas())
65 65
         {
66
-            $this->schema = $adapterConfig->getSchemas ();
66
+            $this->schema = $adapterConfig->getSchemas();
67 67
         }
68 68
 
69 69
     }
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @return string[]
77 77
      */
78
-    public function getListNameTable ()
78
+    public function getListNameTable()
79 79
     {
80
-        if ( empty( $this->tableList ) )
80
+        if (empty($this->tableList))
81 81
         {
82
-            $strSchema = implode ( "', '" , $this->schema );
82
+            $strSchema = implode("', '", $this->schema);
83 83
 
84
-            $this->tableList = $this->getPDO ()->query (
84
+            $this->tableList = $this->getPDO()->query(
85 85
                 "SELECT table_schema,
86 86
               table_name
87 87
              FROM information_schema.tables
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
                table_schema,
93 93
                table_name
94 94
               ASC"
95
-            )->fetchAll ();
95
+            )->fetchAll();
96 96
         }
97 97
 
98 98
         return $this->tableList;
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return array
105 105
      */
106
-    public function getListColumns ()
106
+    public function getListColumns()
107 107
     {
108
-        $strSchema = implode ( "', '" , $this->schema );
108
+        $strSchema = implode("', '", $this->schema);
109 109
 
110
-        return $this->getPDO ()->query (
110
+        return $this->getPDO()->query(
111 111
             "SELECT distinct
112 112
 	c.table_schema,
113 113
 	c.table_name,
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 		ON st.table_name=c.table_name and st.table_type = 'BASE TABLE'
122 122
 		and  c.table_schema IN ('$strSchema')
123 123
 		order by c.table_name asc"
124
-        )->fetchAll ( \PDO::FETCH_ASSOC );
124
+        )->fetchAll(\PDO::FETCH_ASSOC);
125 125
     }
126 126
 
127
-    public function getListConstrant ()
127
+    public function getListConstrant()
128 128
     {
129
-        $strSchema = implode ( "', '" , $this->schema );
129
+        $strSchema = implode("', '", $this->schema);
130 130
 
131
-        return $this->getPDO ()->query (
131
+        return $this->getPDO()->query(
132 132
             "SELECT distinct
133 133
                 tc.constraint_type,
134 134
                 tc.constraint_name,
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                       ON tc.constraint_name  = ccu.constraint_name
149 149
                         AND tc.constraint_schema = ccu.constraint_schema
150 150
                     ORDER by tc.table_schema"
151
-        )->fetchAll ( \PDO::FETCH_ASSOC );
151
+        )->fetchAll(\PDO::FETCH_ASSOC);
152 152
     }
153 153
 
154 154
     /**
@@ -159,23 +159,23 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * @return string
161 161
      */
162
-    public function getSequence ( $table , $column , $schema = 0 )
162
+    public function getSequence($table, $column, $schema = 0)
163 163
     {
164
-        $tableTemp=$table;
165
-        if(0!==$schema){
166
-            $tableTemp = $schema.'.'.$table;
164
+        $tableTemp = $table;
165
+        if (0 !== $schema) {
166
+            $tableTemp = $schema . '.' . $table;
167 167
         }
168 168
 
169
-        $pdo = $this->getPDO ();
170
-        $return1 = $pdo->query ( "SELECT pg_get_serial_sequence('$tableTemp', '$column');" )
171
-                       ->fetchColumn ();
169
+        $pdo = $this->getPDO();
170
+        $return1 = $pdo->query("SELECT pg_get_serial_sequence('$tableTemp', '$column');")
171
+                       ->fetchColumn();
172 172
 
173
-        if ( !is_null($return1) )
173
+        if ( ! is_null($return1))
174 174
         {
175 175
             return $return1;
176 176
         }
177 177
 
178
-        $stmt = $pdo->prepare (
178
+        $stmt = $pdo->prepare(
179 179
             "SELECT distinct adsrc FROM pg_attrdef AS att
180 180
             INNER JOIN pg_class AS c
181 181
               ON adrelid = c.oid AND c.relname = ? --table
@@ -186,19 +186,19 @@  discard block
 block discarded – undo
186 186
               "
187 187
         );
188 188
 
189
-        $stmt->bindParam ( 1 , $table );
190
-        $stmt->bindParam ( 2 , $column );
191
-        $stmt->bindParam ( 3 , $schema );
192
-        $stmt->execute ();
193
-        $return2 = $stmt->fetchColumn ();
189
+        $stmt->bindParam(1, $table);
190
+        $stmt->bindParam(2, $column);
191
+        $stmt->bindParam(3, $schema);
192
+        $stmt->execute();
193
+        $return2 = $stmt->fetchColumn();
194 194
 
195
-        if ( $return2 )
195
+        if ($return2)
196 196
         {
197
-            return preg_filter (
198
-                array (
199
-                    '/nextval\(\'/' ,
197
+            return preg_filter(
198
+                array(
199
+                    '/nextval\(\'/',
200 200
                     '/\'::regclass\)/'
201
-                ) , '' , $return2
201
+                ), '', $return2
202 202
             );
203 203
         }
204 204
 
@@ -208,12 +208,12 @@  discard block
 block discarded – undo
208 208
      * @inheritDoc
209 209
      * @return string
210 210
      */
211
-    public function getPDOString ()
211
+    public function getPDOString()
212 212
     {
213
-        return sprintf (
214
-            "pgsql:host=%s;port=%s;dbname=%s" ,
215
-            $this->host ,
216
-            $this->port ,
213
+        return sprintf(
214
+            "pgsql:host=%s;port=%s;dbname=%s",
215
+            $this->host,
216
+            $this->port,
217 217
             $this->database
218 218
 
219 219
         );
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
      * @inheritDoc
224 224
      * @return string
225 225
      */
226
-    public function getPDOSocketString ()
226
+    public function getPDOSocketString()
227 227
     {
228
-        return sprintf (
229
-            "pgsql:unix_socket=%s;dbname=%s" ,
230
-            $this->socket ,
228
+        return sprintf(
229
+            "pgsql:unix_socket=%s;dbname=%s",
230
+            $this->socket,
231 231
             $this->database
232 232
 
233 233
         );
@@ -238,19 +238,19 @@  discard block
 block discarded – undo
238 238
      *
239 239
      * @return int
240 240
      */
241
-    public function getTotalTables ()
241
+    public function getTotalTables()
242 242
     {
243
-        if ( empty( $this->totalTables ) )
243
+        if (empty($this->totalTables))
244 244
         {
245
-            $strSchema = implode ( "', '" , $this->schema );
245
+            $strSchema = implode("', '", $this->schema);
246 246
 
247
-            $this->totalTables = $this->getPDO ()->query (
247
+            $this->totalTables = $this->getPDO()->query(
248 248
                 "SELECT COUNT(table_name)  AS total
249 249
              FROM information_schema.tables
250 250
              WHERE
251 251
               table_type = 'BASE TABLE'
252 252
               AND table_schema IN ( '" . $strSchema . "' )"
253
-            )->fetchColumn ();
253
+            )->fetchColumn();
254 254
         }
255 255
 
256 256
         return (int) $this->totalTables;
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/AbstractAdapter.php 1 patch
Spacing   +121 added lines, -121 removed lines patch added patch discarded remove patch
@@ -14,68 +14,68 @@  discard block
 block discarded – undo
14 14
 abstract class AbstractAdapter
15 15
 {
16 16
 
17
-    protected $arrConfig = array (
17
+    protected $arrConfig = array(
18 18
         ############################# DATABASE
19 19
         //Driver do banco de dados
20
-        'driver'   => null ,
20
+        'driver'   => null,
21 21
         //Nome do banco de dados
22
-        'database' => null ,
22
+        'database' => null,
23 23
         //Host do banco
24
-        'host'     => 'localhost' ,
24
+        'host'     => 'localhost',
25 25
         //Port do banco
26
-        'port'     => '' ,
26
+        'port'     => '',
27 27
         //usuario do banco
28
-        'username' => null ,
28
+        'username' => null,
29 29
         //senha do banco
30
-        'password' => null ,
30
+        'password' => null,
31 31
         // lista de schemas do banco de dados
32
-        'schema'   => array () ,
32
+        'schema'   => array(),
33 33
 
34
-        'socket'          => null ,
34
+        'socket'          => null,
35 35
 
36 36
         ########################### DOCS
37 37
         // autor que gerou o script
38
-        'author'          => "Pedro" ,
39
-        'license'         => "New BSD License" ,
40
-        'copyright'       => "ORM Generator - Pedro151" ,
41
-        'link'            => 'https://github.com/pedro151/orm-generator' ,
38
+        'author'          => "Pedro",
39
+        'license'         => "New BSD License",
40
+        'copyright'       => "ORM Generator - Pedro151",
41
+        'link'            => 'https://github.com/pedro151/orm-generator',
42 42
         // data que foi gerado o script
43
-        'last_modify'     => null ,
43
+        'last_modify'     => null,
44 44
 
45 45
         ########################## Ambiente/Arquivos
46 46
 
47 47
         // Nome do framework para o adapter
48
-        'framework'       => null ,
48
+        'framework'       => null,
49 49
         // namespace das classes
50
-        'namespace'       => "" ,
50
+        'namespace'       => "",
51 51
         // caminho onde os arquivos devem ser criados
52
-        'path'            => 'models' ,
52
+        'path'            => 'models',
53 53
         // flag para gerar pasta com o nome do driver do banco de dados
54
-        'folder-database' => 0 ,
54
+        'folder-database' => 0,
55 55
 
56 56
         ############################## Comandos adicionais
57 57
         //flag para mostrar o status da execução ao termino do processo
58
-        'status'          => false ,
58
+        'status'          => false,
59 59
         // flags para criar todas as tabelas ou nao
60
-        'allTables'       => true ,
60
+        'allTables'       => true,
61 61
         //Lista de tabelas a serem ignoradas
62
-        'ignoreTable'     => array () ,
62
+        'ignoreTable'     => array(),
63 63
     );
64 64
 
65 65
     /**
66 66
      * @var string[] um array com todos os campos obrigatorios
67 67
      */
68
-    protected $attRequered = array (
69
-        'driver'   => true ,
70
-        'database' => true ,
71
-        'host'     => true ,
72
-        'username' => true ,
68
+    protected $attRequered = array(
69
+        'driver'   => true,
70
+        'database' => true,
71
+        'host'     => true,
72
+        'username' => true,
73 73
         'path'     => true
74 74
     );
75 75
 
76
-    protected $arrFunc = array ();
76
+    protected $arrFunc = array();
77 77
 
78
-    private $framworkFiles = array ();
78
+    private $framworkFiles = array();
79 79
 
80 80
     const SEPARETOR = "";
81 81
 
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      *
85 85
      * @return bool
86 86
      */
87
-    protected function checkConfig ()
87
+    protected function checkConfig()
88 88
     {
89
-        if ( array_diff_key ( $this->attRequered , array_filter ( $this->arrConfig ) ) )
89
+        if (array_diff_key($this->attRequered, array_filter($this->arrConfig)))
90 90
         {
91 91
             return false;
92 92
         }
@@ -99,33 +99,33 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return array
101 101
      */
102
-    abstract protected function getParams ();
102
+    abstract protected function getParams();
103 103
 
104 104
     /**
105 105
      * Popula as config do generater com as configuraçoes do framework
106 106
      *
107 107
      * @return mixed
108 108
      */
109
-    abstract protected function parseFrameworkConfig ();
109
+    abstract protected function parseFrameworkConfig();
110 110
 
111 111
     /**
112 112
      * Cria Instancias dos arquivos que devem ser gerados
113 113
      *
114 114
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
115 115
      */
116
-    abstract public function getMakeFileInstances ();
116
+    abstract public function getMakeFileInstances();
117 117
 
118
-    abstract protected function init ();
118
+    abstract protected function init();
119 119
 
120 120
     /**
121 121
      * retorna a base do Namespace
122 122
      *
123 123
      * @return array
124 124
      */
125
-    protected function getBaseNamespace ()
125
+    protected function getBaseNamespace()
126 126
     {
127
-        return array (
128
-            $this->arrConfig[ 'namespace' ] ,
127
+        return array(
128
+            $this->arrConfig['namespace'],
129 129
             'Model'
130 130
         );
131 131
     }
@@ -136,44 +136,44 @@  discard block
 block discarded – undo
136 136
      * @return mixed
137 137
      */
138 138
 
139
-    public function createClassNamespace ( $table )
139
+    public function createClassNamespace($table)
140 140
     {
141
-        $arrNames = $this->getBaseNamespace ();
141
+        $arrNames = $this->getBaseNamespace();
142 142
 
143
-        if ( isset( $this->arrConfig[ 'folder-database' ] )
144
-             && $this->arrConfig[ 'folder-database' ]
143
+        if (isset($this->arrConfig['folder-database'])
144
+             && $this->arrConfig['folder-database']
145 145
         )
146 146
         {
147
-            $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig[ 'driver' ] );
147
+            $arrNames[] = AbstractMaker::getClassName($this->arrConfig['driver']);
148 148
         }
149 149
 
150
-        if ( $table->hasSchema () )
150
+        if ($table->hasSchema())
151 151
         {
152
-            $arrNames[] = AbstractMaker::getClassName ( $table->getSchema () );
152
+            $arrNames[] = AbstractMaker::getClassName($table->getSchema());
153 153
         } else
154 154
         {
155
-            $arrNames[] = AbstractMaker::getClassName ( $table->getDatabase () );
155
+            $arrNames[] = AbstractMaker::getClassName($table->getDatabase());
156 156
         }
157 157
 
158
-        return implode ( static::SEPARETOR , array_filter ( $arrNames ) );
158
+        return implode(static::SEPARETOR, array_filter($arrNames));
159 159
     }
160 160
 
161
-    public function __construct ( $array )
161
+    public function __construct($array)
162 162
     {
163
-        $array += array (
164
-            'author'      => ucfirst ( get_current_user () ) ,
165
-            'last_modify' => date ( "d-m-Y H:i:s." )
163
+        $array += array(
164
+            'author'      => ucfirst(get_current_user()),
165
+            'last_modify' => date("d-m-Y H:i:s.")
166 166
         );
167 167
 
168
-        $this->setFrameworkFiles ( $array );
169
-        $this->parseFrameworkConfig ();
170
-        $this->setParams ( $this->getParams () );
171
-        $this->setParams ( $array );
172
-        $this->init ();
173
-        if ( ! $this->isValid () )
168
+        $this->setFrameworkFiles($array);
169
+        $this->parseFrameworkConfig();
170
+        $this->setParams($this->getParams());
171
+        $this->setParams($array);
172
+        $this->init();
173
+        if ( ! $this->isValid())
174 174
         {
175
-            $var = array_diff_key ( $this->attRequered , array_filter ( $this->arrConfig ) );
176
-            throw new Exception( $var );
175
+            $var = array_diff_key($this->attRequered, array_filter($this->arrConfig));
176
+            throw new Exception($var);
177 177
         }
178 178
     }
179 179
 
@@ -182,47 +182,47 @@  discard block
 block discarded – undo
182 182
      *
183 183
      * @param $array
184 184
      */
185
-    public function setFrameworkFiles ( $array )
185
+    public function setFrameworkFiles($array)
186 186
     {
187
-        $this->framworkFiles[ 'library' ] = isset( $array[ 'framework-path-library' ] )
188
-            ? $array[ 'framework-path-library' ]
187
+        $this->framworkFiles['library'] = isset($array['framework-path-library'])
188
+            ? $array['framework-path-library']
189 189
             : null;
190 190
 
191
-        $this->framworkFiles[ 'ini' ] = isset( $array[ 'framework-ini' ] )
192
-            ? $array[ 'framework-ini' ]
191
+        $this->framworkFiles['ini'] = isset($array['framework-ini'])
192
+            ? $array['framework-ini']
193 193
             : null;
194 194
 
195
-        $this->framworkFiles[ 'environment' ] = isset( $array[ 'environment' ] )
196
-            ? $array[ 'environment' ]
195
+        $this->framworkFiles['environment'] = isset($array['environment'])
196
+            ? $array['environment']
197 197
             : 'production';
198 198
 
199 199
     }
200 200
 
201
-    protected function isValidFrameworkFiles ()
201
+    protected function isValidFrameworkFiles()
202 202
     {
203
-        if ( ! is_file ( $this->framworkFiles[ 'ini' ] ) )
203
+        if ( ! is_file($this->framworkFiles['ini']))
204 204
         {
205 205
             return false;
206 206
         }
207 207
 
208
-        if ( ! is_dir ( $this->framworkFiles[ 'library' ] ) )
208
+        if ( ! is_dir($this->framworkFiles['library']))
209 209
         {
210 210
             return false;
211 211
         }
212 212
 
213 213
 
214
-        if ( ! isset ( $this->framworkFiles[ 'environment' ] )
215
-             or empty( $this->framworkFiles[ 'environment' ] )
214
+        if ( ! isset ($this->framworkFiles['environment'])
215
+             or empty($this->framworkFiles['environment'])
216 216
         )
217 217
         {
218 218
             return false;
219 219
         }
220
-        set_include_path (
221
-            implode (
222
-                PATH_SEPARATOR ,
223
-                array (
224
-                    realpath ( $this->framworkFiles[ 'library' ] ) ,
225
-                    get_include_path () ,
220
+        set_include_path(
221
+            implode(
222
+                PATH_SEPARATOR,
223
+                array(
224
+                    realpath($this->framworkFiles['library']),
225
+                    get_include_path(),
226 226
                 )
227 227
             )
228 228
         );
@@ -230,120 +230,120 @@  discard block
 block discarded – undo
230 230
         return true;
231 231
     }
232 232
 
233
-    protected function getFrameworkIni ()
233
+    protected function getFrameworkIni()
234 234
     {
235
-        return $this->framworkFiles[ 'ini' ];
235
+        return $this->framworkFiles['ini'];
236 236
     }
237 237
 
238
-    protected function getEnvironment ()
238
+    protected function getEnvironment()
239 239
     {
240
-        return $this->framworkFiles[ 'environment' ];
240
+        return $this->framworkFiles['environment'];
241 241
     }
242 242
 
243 243
     /**
244 244
      * Popula as variaveis de acordo com o arquivo de configuração do seu  framework
245 245
      */
246
-    protected function isValid ()
246
+    protected function isValid()
247 247
     {
248
-        return $this->checkConfig ();
248
+        return $this->checkConfig();
249 249
     }
250 250
 
251
-    private function setParams ( $array )
251
+    private function setParams($array)
252 252
     {
253
-        if ( count ( $array ) > 0 )
253
+        if (count($array) > 0)
254 254
         {
255
-            $this->arrConfig = array_filter ( $array ) + $this->arrConfig;
255
+            $this->arrConfig = array_filter($array) + $this->arrConfig;
256 256
         }
257 257
     }
258 258
 
259 259
     /**
260 260
      * @return string
261 261
      */
262
-    public function getDatabase ()
262
+    public function getDatabase()
263 263
     {
264
-        return $this->arrConfig[ 'database' ];
264
+        return $this->arrConfig['database'];
265 265
     }
266 266
 
267 267
     /**
268 268
      * @return bool
269 269
      */
270
-    public function hasSchemas ()
270
+    public function hasSchemas()
271 271
     {
272
-        return ! empty ( $this->arrConfig[ 'schema' ] );
272
+        return ! empty ($this->arrConfig['schema']);
273 273
     }
274 274
 
275 275
     /**
276 276
      * @return string[]
277 277
      */
278
-    public function getSchemas ()
278
+    public function getSchemas()
279 279
     {
280
-        if ( is_string ( $this->arrConfig[ 'schema' ] ) )
280
+        if (is_string($this->arrConfig['schema']))
281 281
         {
282
-            return array ( $this->arrConfig[ 'schema' ] );
282
+            return array($this->arrConfig['schema']);
283 283
         }
284 284
 
285
-        return $this->arrConfig[ 'schema' ];
285
+        return $this->arrConfig['schema'];
286 286
     }
287 287
 
288
-    public function setSchema ( $schema )
288
+    public function setSchema($schema)
289 289
     {
290
-        $this->arrConfig[ 'schema' ] = $schema;
290
+        $this->arrConfig['schema'] = $schema;
291 291
     }
292 292
 
293 293
     /**
294 294
      * @return string
295 295
      */
296
-    public function getHost ()
296
+    public function getHost()
297 297
     {
298
-        return $this->arrConfig[ 'host' ];
298
+        return $this->arrConfig['host'];
299 299
     }
300 300
 
301 301
     /**
302 302
      * @return int
303 303
      */
304
-    public function getPort ()
304
+    public function getPort()
305 305
     {
306
-        return $this->arrConfig[ 'port' ];
306
+        return $this->arrConfig['port'];
307 307
     }
308 308
 
309 309
     /**
310 310
      * @return boolean
311 311
      */
312
-    public function hasPort ()
312
+    public function hasPort()
313 313
     {
314
-        return ! empty( $this->arrConfig[ 'port' ] );
314
+        return ! empty($this->arrConfig['port']);
315 315
     }
316 316
 
317 317
     /**
318 318
      * @return string
319 319
      */
320
-    public function getSocket ()
320
+    public function getSocket()
321 321
     {
322
-        return $this->arrConfig[ 'socket' ];
322
+        return $this->arrConfig['socket'];
323 323
     }
324 324
 
325 325
     /**
326 326
      * @return string
327 327
      */
328
-    public function getUser ()
328
+    public function getUser()
329 329
     {
330
-        return $this->arrConfig[ 'username' ];
330
+        return $this->arrConfig['username'];
331 331
     }
332 332
 
333 333
     /**
334 334
      * @return string
335 335
      */
336
-    public function getPassword ()
336
+    public function getPassword()
337 337
     {
338
-        return $this->arrConfig[ 'password' ];
338
+        return $this->arrConfig['password'];
339 339
     }
340 340
 
341 341
     /**
342 342
      * @return bool
343 343
      */
344
-    public function isStatusEnabled ()
344
+    public function isStatusEnabled()
345 345
     {
346
-        return (bool) $this->arrConfig[ 'status' ];
346
+        return (bool) $this->arrConfig['status'];
347 347
     }
348 348
 
349 349
     /**
@@ -351,23 +351,23 @@  discard block
 block discarded – undo
351 351
      *
352 352
      * @return string
353 353
      */
354
-    public function __get ( $str )
354
+    public function __get($str)
355 355
     {
356
-        $arr = array (
357
-            'namespace' ,
358
-            'framework' ,
359
-            'author' ,
360
-            'license' ,
361
-            'copyright' ,
362
-            'link' ,
363
-            'last_modify' ,
364
-            'path' ,
356
+        $arr = array(
357
+            'namespace',
358
+            'framework',
359
+            'author',
360
+            'license',
361
+            'copyright',
362
+            'link',
363
+            'last_modify',
364
+            'path',
365 365
             'folder-database'
366 366
         );
367 367
 
368
-        if ( in_array ( $str , $arr ) )
368
+        if (in_array($str, $arr))
369 369
         {
370
-            return $this->arrConfig[ strtolower ( $str ) ];
370
+            return $this->arrConfig[strtolower($str)];
371 371
         }
372 372
 
373 373
         return;
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/ZendFrameworkOne.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     const SEPARETOR = "_";
24 24
 
25
-    protected function init ()
25
+    protected function init()
26 26
     {
27 27
     }
28 28
 
@@ -31,50 +31,50 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @return array
33 33
      */
34
-    protected function getParams ()
34
+    protected function getParams()
35 35
     {
36
-        if ( ! $this->config or ! $this->isValidFrameworkFiles () )
36
+        if ( ! $this->config or ! $this->isValidFrameworkFiles())
37 37
         {
38
-            return array ();
38
+            return array();
39 39
         }
40 40
 
41
-        return array (
41
+        return array(
42 42
             //Driver do banco de dados
43
-            'driver'   => $this->config[ 'adapter' ] ,
43
+            'driver'   => $this->config['adapter'],
44 44
             //Nome do banco de dados
45
-            'database' => $this->config[ 'params' ][ 'dbname' ] ,
45
+            'database' => $this->config['params']['dbname'],
46 46
             //Host do banco
47
-            'host'     => $this->config[ 'params' ][ 'host' ] ,
47
+            'host'     => $this->config['params']['host'],
48 48
             //Port do banco
49
-            'port'     => isset( $this->config[ 'params' ][ 'port' ] )
50
-                ? $this->config[ 'params' ][ 'port' ] : '' ,
49
+            'port'     => isset($this->config['params']['port'])
50
+                ? $this->config['params']['port'] : '',
51 51
             //usuario do banco
52
-            'username' => $this->config[ 'params' ][ 'username' ] ,
52
+            'username' => $this->config['params']['username'],
53 53
             //senha do banco
54
-            'password' => $this->config[ 'params' ][ 'password' ] ,
54
+            'password' => $this->config['params']['password'],
55 55
         );
56 56
     }
57 57
 
58
-    protected function parseFrameworkConfig ()
58
+    protected function parseFrameworkConfig()
59 59
     {
60
-        if ( ! $this->isValidFrameworkFiles () )
60
+        if ( ! $this->isValidFrameworkFiles())
61 61
         {
62 62
             return;
63 63
         }
64 64
 
65
-        $frameworkIni = $this->getFrameworkIni ();
65
+        $frameworkIni = $this->getFrameworkIni();
66 66
 
67 67
         require_once 'Zend/Config/Ini.php';
68 68
 
69 69
         $objConfig = new \Zend_Config_Ini(
70
-            realpath ( $frameworkIni ) , $this->getEnvironment ()
70
+            realpath($frameworkIni), $this->getEnvironment()
71 71
         );
72 72
 
73
-        $arrConfig = $objConfig->toArray ();
73
+        $arrConfig = $objConfig->toArray();
74 74
 
75
-        if ( isset( $arrConfig[ 'resources' ][ 'db' ] ) )
75
+        if (isset($arrConfig['resources']['db']))
76 76
         {
77
-            $this->config = $arrConfig[ 'resources' ][ 'db' ];
77
+            $this->config = $arrConfig['resources']['db'];
78 78
         }
79 79
     }
80 80
 
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
85 85
      */
86
-    public function getMakeFileInstances ()
86
+    public function getMakeFileInstances()
87 87
     {
88
-        return array (
89
-            DbTable::getInstance () ,
90
-            Entity::getInstance () ,
91
-            Model::getInstance ()
88
+        return array(
89
+            DbTable::getInstance(),
90
+            Entity::getInstance(),
91
+            Model::getInstance()
92 92
         );
93 93
     }
94 94
 
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
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     const SEPARETOR = "\\";
25 25
 
26
-    protected function init ()
26
+    protected function init()
27 27
     {
28 28
     }
29 29
 
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @return array
34 34
      */
35
-    protected function getParams ()
35
+    protected function getParams()
36 36
     {
37 37
 
38 38
     }
39 39
 
40
-    protected function parseFrameworkConfig ()
40
+    protected function parseFrameworkConfig()
41 41
     {
42 42
         // TODO: Implement parseFrameworkConfig() method.
43 43
     }
@@ -45,18 +45,18 @@  discard block
 block discarded – undo
45 45
     /**
46 46
      * @inheritdoc
47 47
      */
48
-    protected function getBaseNamespace ()
48
+    protected function getBaseNamespace()
49 49
     {
50
-        if ( ! $this->arrConfig[ 'namespace' ] )
50
+        if ( ! $this->arrConfig['namespace'])
51 51
         {
52
-            return array (
53
-                'App' ,
52
+            return array(
53
+                'App',
54 54
                 'Model'
55 55
             );
56 56
         }
57 57
 
58
-        return array (
59
-            $this->arrConfig[ 'namespace' ] ,
58
+        return array(
59
+            $this->arrConfig['namespace'],
60 60
             'Model'
61 61
         );
62 62
     }
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
      *
66 66
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
67 67
      */
68
-    public function getMakeFileInstances ()
68
+    public function getMakeFileInstances()
69 69
     {
70
-        return array (
71
-            Entity::getInstance () ,
72
-            Model::getInstance ()
70
+        return array(
71
+            Entity::getInstance(),
72
+            Model::getInstance()
73 73
         );
74 74
     }
75 75
 
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/None.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     const SEPARETOR = "_";
24 24
 
25
-    protected function init ()
25
+    protected function init()
26 26
     {
27 27
     }
28 28
 
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
      *
32 32
      * @return array
33 33
      */
34
-    protected function getParams ()
34
+    protected function getParams()
35 35
     {
36 36
 
37 37
     }
38 38
 
39
-    protected function parseFrameworkConfig ()
39
+    protected function parseFrameworkConfig()
40 40
     {
41 41
         // TODO: Implement parseFrameworkConfig() method.
42 42
     }
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
      *
47 47
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
48 48
      */
49
-    public function getMakeFileInstances ()
49
+    public function getMakeFileInstances()
50 50
     {
51
-        return array (
52
-            DbTable::getInstance (),
53
-            Entity::getInstance (),
54
-            Model::getInstance ()
51
+        return array(
52
+            DbTable::getInstance(),
53
+            Entity::getInstance(),
54
+            Model::getInstance()
55 55
         );
56 56
     }
57 57
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/AbstractAdapter.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,27 +11,27 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @type AbstractAdapter[]
13 13
      */
14
-    private static $_instance = array ();
14
+    private static $_instance = array();
15 15
 
16 16
     /**
17 17
      *
18 18
      */
19
-    final private function __construct ()
19
+    final private function __construct()
20 20
     {
21 21
     }
22 22
 
23 23
     /**
24 24
      * @return \Classes\AdapterMakerFile\AbstractAdapter
25 25
      */
26
-    public static function getInstance ()
26
+    public static function getInstance()
27 27
     {
28
-        $class = get_called_class ();
29
-        if ( !isset( self::$_instance[ $class ] ) )
28
+        $class = get_called_class();
29
+        if ( ! isset(self::$_instance[$class]))
30 30
         {
31
-            self::$_instance[ $class ] = new $class();
31
+            self::$_instance[$class] = new $class();
32 32
         }
33 33
 
34
-        return self::$_instance[ $class ];
34
+        return self::$_instance[$class];
35 35
     }
36 36
 
37 37
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return array
42 42
      */
43
-    abstract public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable );
43
+    abstract public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable);
44 44
 
45 45
     /**
46 46
      * @type string
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * @return bool
74 74
      */
75
-    public function hasDiretory ()
75
+    public function hasDiretory()
76 76
     {
77
-        return !empty( $this->pastName );
77
+        return ! empty($this->pastName);
78 78
     }
79 79
 
80 80
     /**
81 81
      * @return string
82 82
      */
83
-    public function getParentClass ()
83
+    public function getParentClass()
84 84
     {
85 85
         return $this->parentClass;
86 86
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     /**
90 90
      * @return string
91 91
      */
92
-    public function getFileTpl ()
92
+    public function getFileTpl()
93 93
     {
94 94
         return $this->fileTpl;
95 95
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     /**
98 98
      * @return string
99 99
      */
100
-    public function getParentFileTpl ()
100
+    public function getParentFileTpl()
101 101
     {
102 102
         return $this->parentFileTpl;
103 103
     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     /**
106 106
      * @return string
107 107
      */
108
-    public function getPastName ()
108
+    public function getPastName()
109 109
     {
110 110
         return $this->pastName;
111 111
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     /**
114 114
      * @return bool
115 115
      */
116
-    public function isOverwrite ()
116
+    public function isOverwrite()
117 117
     {
118 118
        return $this->overwrite;
119 119
     }
Please login to merge, or discard this patch.