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
Pull Request — master (#10)
by Pedro
02:50
created
build/Classes/templates/zf1/entity.php 2 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -140,9 +140,12 @@  discard block
 block discarded – undo
140 140
     * Stored in ISO 8601 format.
141 141
     *
142 142
     * @param string|Zend_Date $<?=$column->getName() . "\n"?>
143
-<?php else: ?>
143
+<?php else {
144
+    : ?>
144 145
     * @param <?=$column->getType()?> $<?=$column->getName() . "\n"?>
145
-<?php endif; ?>
146
+<?php endif;
147
+}
148
+?>
146 149
     * @return <?=$className . "\n"?>
147 150
     */
148 151
     public function set<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>($<?=$column->getName()?>)
@@ -189,9 +192,12 @@  discard block
 block discarded – undo
189 192
 <?php if ($column->getType()=='date'): ?>
190 193
     * @param boolean $returnZendDate
191 194
     * @return Zend_Date|null|string Zend_Date representation of this datetime if enabled, or ISO 8601 string if not
192
-<?php else: ?>
195
+<?php else {
196
+    : ?>
193 197
     * @return <?=$column->getType() . "\n"?>
194
-<?php endif; ?>
198
+<?php endif;
199
+}
200
+?>
195 201
     */
196 202
     public function get<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>(<?php if ($column->getType()=='date'): ?>$returnZendDate = false <?php endif;?>)
197 203
     {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,36 +1,36 @@  discard block
 block discarded – undo
1 1
 <?="<?php\n"?>
2
-<?php $className = $objTables->getNamespace(). '_Entity_' . \Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?>
2
+<?php $className = $objTables->getNamespace() . '_Entity_' . \Classes\Maker\AbstractMaker::getClassName($objTables->getName())?>
3 3
 
4 4
 /**
5 5
  * Application Entity
6 6
  *
7
- * <?=$this->config->last_modify."\n"?>
7
+ * <?=$this->config->last_modify . "\n"?>
8 8
  *
9
- * @package <?=$objTables->getNamespace()."\n"?>
9
+ * @package <?=$objTables->getNamespace() . "\n"?>
10 10
  * @subpackage Entity
11 11
  *
12
- * @author    <?=$this->config->author."\n"?>
12
+ * @author    <?=$this->config->author . "\n"?>
13 13
  *
14
- * @copyright <?=$this->config->copyright."\n"?>
15
- * @license   <?=$this->config->license."\n"?>
16
- * @link      <?=$this->config->link."\n"?>
17
- * @version   <?=$this->config->version."\n"?>
14
+ * @copyright <?=$this->config->copyright . "\n"?>
15
+ * @license   <?=$this->config->license . "\n"?>
16
+ * @link      <?=$this->config->link . "\n"?>
17
+ * @version   <?=$this->config->version . "\n"?>
18 18
  */
19 19
 
20 20
 /**
21 21
  * Abstract class for entity
22 22
  */
23 23
 
24
-abstract class <?=$className?> extends <?=$this->config->namespace?$this->config->namespace."_":""?>Model_<?=$objMakeFile->getParentClass() . "\n"?>
24
+abstract class <?=$className?> extends <?=$this->config->namespace ? $this->config->namespace . "_" : ""?>Model_<?=$objMakeFile->getParentClass() . "\n"?>
25 25
 {
26 26
 
27 27
 <?php foreach ($objTables->getColumns() as $column): ?>
28 28
     /**
29
-    * Database constraint in the column <?=$column->getName()."\n"?>
29
+    * Database constraint in the column <?=$column->getName() . "\n"?>
30 30
     *
31 31
     */
32 32
     const <?=strtoupper($column->getName())?> = '<?=$objTables->getName()?>.<?=$column->getName()?>';
33
-<?php endforeach;?>
33
+<?php endforeach; ?>
34 34
 
35 35
     /**
36 36
     * Nome da tabela DbTable do model
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     * @var string
39 39
     * @access protected
40 40
     */
41
-    protected $_tableClass = '<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?>';
41
+    protected $_tableClass = '<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?>';
42 42
 
43 43
 /**
44 44
 * @see <?=$this->config->namespace?>Model_EntityAbstract::$_columnsList
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
     protected $_columnsList = array(
47 47
 <?php foreach ($objTables->getColumns() as $column): ?>
48 48
         self::<?=strtoupper($column->getName())?> => '<?=strtolower(\Classes\Maker\AbstractMaker::getClassName($column->getName()))?>',
49
-<?php endforeach;?>
49
+<?php endforeach; ?>
50 50
     );
51 51
 
52 52
     /**
53 53
      * @see <?=$this->config->namespace?>Model_EntityAbstract::$_filters
54 54
      */
55 55
     protected $_filters = array(
56
-<?php foreach ( $objTables->getColumns () as $column ): ?>
56
+<?php foreach ($objTables->getColumns() as $column): ?>
57 57
 <?php
58 58
     $filters = null;
59
-    switch ( ucfirst ( $column->getType () ) )
59
+    switch (ucfirst($column->getType()))
60 60
     {
61 61
         case 'String':
62 62
             $filters = 'StripTags", "StringTrim';
@@ -67,50 +67,50 @@  discard block
 block discarded – undo
67 67
         case 'Date':
68 68
             break;
69 69
         default:
70
-            $filters = ucfirst ( $column->getType () );
70
+            $filters = ucfirst($column->getType());
71 71
             break;
72 72
     }
73 73
 ?>
74 74
         '<?=$column->getName()?>'=>array (
75
-            <?=( !empty( $filters ) ) ? "\"{$filters}\"\n" : null; ?>
75
+            <?=( ! empty($filters)) ? "\"{$filters}\"\n" : null; ?>
76 76
         ),
77
-<?php endforeach;?>
77
+<?php endforeach; ?>
78 78
     );
79 79
 
80 80
     /**
81 81
      * @see <?=$this->config->namespace?>Model_EntityAbstract::$_validators
82 82
      */
83 83
     protected $_validators= array(
84
-<?php foreach ( $objTables->getColumns () as $column ): ?>
84
+<?php foreach ($objTables->getColumns() as $column): ?>
85 85
 <?php
86
-    $validators = array ();
86
+    $validators = array();
87 87
 
88
-    $validators[] = $column->isNullable () ? "'allowEmpty' => true" : "'NotEmpty'";
88
+    $validators[] = $column->isNullable() ? "'allowEmpty' => true" : "'NotEmpty'";
89 89
 
90
-    switch ( ucfirst ( $column->getType () ) )
90
+    switch (ucfirst($column->getType()))
91 91
     {
92 92
         case 'String':
93
-            if ( $column->getMaxLength () )
93
+            if ($column->getMaxLength())
94 94
             {
95
-                $validators[] = "array( 'StringLength', array( 'max' => " . $column->getMaxLength () . " ) )";
95
+                $validators[] = "array( 'StringLength', array( 'max' => " . $column->getMaxLength() . " ) )";
96 96
             }
97 97
 
98 98
             break;
99 99
         case 'Boolean':
100 100
             break;
101 101
         default:
102
-            $name = ucfirst ( $column->getType () );
102
+            $name = ucfirst($column->getType());
103 103
             $validators[] = "'$name'";
104 104
             break;
105 105
     }
106
-    $validators = implode ( ", ", $validators )?>
107
-        '<?= $column->getName () ?>' => array (
108
-             <?=( !empty( $validators ) ) ? "{$validators}\n" : null?>
106
+    $validators = implode(", ", $validators)?>
107
+        '<?= $column->getName() ?>' => array (
108
+             <?=( ! empty($validators)) ? "{$validators}\n" : null?>
109 109
         ),
110 110
 <?php endforeach; ?>
111 111
     );
112 112
 
113
-<?php if( $objTables->hasPrimaryKey() ):?>
113
+<?php if ($objTables->hasPrimaryKey()):?>
114 114
     /**
115 115
     * Nome da Primary Key
116 116
     *
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     */
120 120
 
121 121
     protected $_primary = array(
122
-    <?php foreach($objTables->getPrimarykeys() as $pks) : ?>
122
+    <?php foreach ($objTables->getPrimarykeys() as $pks) : ?>
123 123
         '<?=$pks->getName()?>',
124 124
     <?php endforeach ?>
125 125
     );
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     */
134 134
     protected $_parent_<?=$parent['name']?>;
135 135
 
136
-<?php endforeach;?>
136
+<?php endforeach; ?>
137 137
 <?php foreach ($depends as $depend): ?>
138 138
     /**
139 139
      * Depends relation <?=\Classes\Maker\AbstractMaker::getClassName($depend['table']) . "\n"?>
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
      */
143 143
      protected $_depend_<?=$depend['name']?>;
144 144
 
145
-<?php endforeach;?>
145
+<?php endforeach; ?>
146 146
 <?php foreach ($objTables->getColumns() as $column): ?>
147 147
     /**
148 148
     *
149
-    * Sets column <?=$column->getName()."\n"?>
149
+    * Sets column <?=$column->getName() . "\n"?>
150 150
     *
151
-<?php if ($column->getType()=='date'): ?>
151
+<?php if ($column->getType() == 'date'): ?>
152 152
     * Stored in ISO 8601 format.
153 153
     *
154 154
     * @param string|Zend_Date $<?=$column->getName() . "\n"?>
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     */
160 160
     public function set<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>($<?=$column->getName()?>)
161 161
     {
162
-<?php switch ( $column->getType () ):
162
+<?php switch ($column->getType()):
163 163
         case 'date': ?>
164 164
         if (! empty($<?=$column->getName()?>))
165 165
         {
@@ -198,16 +198,16 @@  discard block
 block discarded – undo
198 198
     /**
199 199
     * Gets column <?=$column->getName() . "\n"?>
200 200
     *
201
-<?php if ($column->getType()=='date'): ?>
201
+<?php if ($column->getType() == 'date'): ?>
202 202
     * @param boolean $returnZendDate
203 203
     * @return Zend_Date|null|string Zend_Date representation of this datetime if enabled, or ISO 8601 string if not
204 204
 <?php else: ?>
205 205
     * @return <?=$column->getType() . "\n"?>
206 206
 <?php endif; ?>
207 207
     */
208
-    public function get<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>(<?php if ($column->getType()=='date'): ?>$returnZendDate = false <?php endif;?>)
208
+    public function get<?=\Classes\Maker\AbstractMaker::getClassName($column->getName())?>(<?php if ($column->getType() == 'date'): ?>$returnZendDate = false <?php endif; ?>)
209 209
     {
210
-<?php if ($column->getType()=='date'): ?>
210
+<?php if ($column->getType() == 'date'): ?>
211 211
         if ($returnZendDate)
212 212
         {
213 213
             if ($this->_data['<?=$column->getName()?>'] === null)
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     {
234 234
         if ($this->_parent_<?=$parent['name']?> === null)
235 235
         {
236
-            $this->_parent_<?=$parent['name']?> = $this->findParentRow('<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName ($parent['table'])?>', '<?=\Classes\Maker\AbstractMaker::getClassName($parent['name'])?>');
236
+            $this->_parent_<?=$parent['name']?> = $this->findParentRow('<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName($parent['table'])?>', '<?=\Classes\Maker\AbstractMaker::getClassName($parent['name'])?>');
237 237
         }
238 238
 
239 239
         return $this->_parent_<?=$parent['name']?>;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
     {
253 253
         if ($this->_depend_<?=$depend['name']?> === null)
254 254
         {
255
-            $this->_depend_<?=$depend['name']?> = $this->findDependentRowset('<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName ($depend['table'])?>');
255
+            $this->_depend_<?=$depend['name']?> = $this->findDependentRowset('<?=$objTables->getNamespace()?>_DbTable_<?=\Classes\Maker\AbstractMaker::getClassName($depend['table'])?>');
256 256
         }
257 257
 
258 258
       return $this->_depend_<?=$depend['name']?>;
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/Entity.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     protected $fileTpl       = "entity.php";
23 23
     protected $overwrite     = true;
24 24
 
25
-    protected $validFunc = array ();
25
+    protected $validFunc = array();
26 26
 
27 27
     /**
28 28
      * @param \Classes\MakerFile  $makerFile
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return array
32 32
      */
33
-    public function parseRelation ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
33
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
34 34
     {
35
-        return array (
36
-            'parents' => $this->listParents ( $makerFile , $dbTable ) ,
37
-            'depends' => $this->listDependence ( $makerFile , $dbTable )
35
+        return array(
36
+            'parents' => $this->listParents($makerFile, $dbTable),
37
+            'depends' => $this->listDependence($makerFile, $dbTable)
38 38
         );
39 39
     }
40 40
 
@@ -44,35 +44,35 @@  discard block
 block discarded – undo
44 44
      *
45 45
      * @return array
46 46
      */
47
-    private function listParents ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
47
+    private function listParents(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
48 48
     {
49
-        $parents = array ();
50
-        foreach ( $dbTable->getForeingkeys () as $objColumn )
49
+        $parents = array();
50
+        foreach ($dbTable->getForeingkeys() as $objColumn)
51 51
         {
52
-            $constrant = $objColumn->getFks ();
52
+            $constrant = $objColumn->getFks();
53 53
             $name =
54 54
                 'Parent'
55 55
                 . ZendFrameworkOne::SEPARETOR
56
-                . AbstractMaker::getClassName ( $constrant->getTable () )
56
+                . AbstractMaker::getClassName($constrant->getTable())
57 57
                 . ZendFrameworkOne::SEPARETOR
58 58
                 . 'By'
59 59
                 . ZendFrameworkOne::SEPARETOR
60
-                . $objColumn->getName ();
60
+                . $objColumn->getName();
61 61
 
62
-            $arrClass = array (
63
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
64
-                AbstractMaker::getClassName ( $constrant->getTable () )
62
+            $arrClass = array(
63
+                $makerFile->getConfig()->createClassNamespace($constrant),
64
+                AbstractMaker::getClassName($constrant->getTable())
65 65
             );
66
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
66
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
67 67
 
68
-            $parents[] = array (
69
-                'class'    => $class ,
70
-                'function' => AbstractMaker::getClassName ( $name ) ,
71
-                'table'    => $constrant->getTable () ,
72
-                'column'   => $objColumn->getName () ,
73
-                'name'     => $constrant->getNameConstrant () ,
68
+            $parents[] = array(
69
+                'class'    => $class,
70
+                'function' => AbstractMaker::getClassName($name),
71
+                'table'    => $constrant->getTable(),
72
+                'column'   => $objColumn->getName(),
73
+                'name'     => $constrant->getNameConstrant(),
74 74
             );
75
-            unset( $name );
75
+            unset($name);
76 76
         }
77 77
 
78 78
         return $parents;
@@ -84,40 +84,40 @@  discard block
 block discarded – undo
84 84
      *
85 85
      * @return array
86 86
      */
87
-    private function listDependence ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
87
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
88 88
     {
89
-        $depends = array ();
90
-        foreach ( $dbTable->getDependences () as $objColumn )
89
+        $depends = array();
90
+        foreach ($dbTable->getDependences() as $objColumn)
91 91
         {
92
-            foreach ( $objColumn->getDependences () as $dependence )
92
+            foreach ($objColumn->getDependences() as $dependence)
93 93
             {
94 94
                 $name =
95 95
                     'Depend'
96 96
                     . ZendFrameworkOne::SEPARETOR
97
-                    . AbstractMaker::getClassName ( $dependence->getTable () )
97
+                    . AbstractMaker::getClassName($dependence->getTable())
98 98
                     . ZendFrameworkOne::SEPARETOR
99 99
                     . 'By'
100 100
                     . ZendFrameworkOne::SEPARETOR
101
-                    . $objColumn->getName ();
101
+                    . $objColumn->getName();
102 102
 
103
-                if ( ! key_exists ( $name , $this->validFunc ) )
103
+                if ( ! key_exists($name, $this->validFunc))
104 104
                 {
105
-                    $arrClass = array (
106
-                        $makerFile->getConfig ()->createClassNamespace ( $dependence ),
107
-                        AbstractMaker::getClassName ( $dependence->getTable () )
105
+                    $arrClass = array(
106
+                        $makerFile->getConfig()->createClassNamespace($dependence),
107
+                        AbstractMaker::getClassName($dependence->getTable())
108 108
                     );
109
-                    $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
109
+                    $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
110 110
 
111
-                    $this->validFunc[ $name ] = true;
112
-                    $depends[] = array (
111
+                    $this->validFunc[$name] = true;
112
+                    $depends[] = array(
113 113
                         'class'    =>  $class,
114
-                        'function' => AbstractMaker::getClassName ( $name ) ,
115
-                        'table'    => $dependence->getTable () ,
116
-                        'column'   => $dependence->getColumn () ,
117
-                        'name'     => $dependence->getNameConstrant ()
114
+                        'function' => AbstractMaker::getClassName($name),
115
+                        'table'    => $dependence->getTable(),
116
+                        'column'   => $dependence->getColumn(),
117
+                        'name'     => $dependence->getNameConstrant()
118 118
                     );
119 119
                 }
120
-                unset( $name );
120
+                unset($name);
121 121
             }
122 122
         }
123 123
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/DbTable.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -28,67 +28,67 @@
 block discarded – undo
28 28
      *
29 29
      * @return array
30 30
      */
31
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
31
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
32 32
     {
33 33
         $referenceMap = '';
34
-        $references = array ();
34
+        $references = array();
35 35
         $dependentTables = '';
36
-        $dependents = array ();
37
-        foreach ( $dbTable->getForeingkeys () as $objColumn )
36
+        $dependents = array();
37
+        foreach ($dbTable->getForeingkeys() as $objColumn)
38 38
         {
39
-            $constrant = $objColumn->getFks ();
39
+            $constrant = $objColumn->getFks();
40 40
 
41
-            $arrClass = array (
42
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
41
+            $arrClass = array(
42
+                $makerFile->getConfig()->createClassNamespace($constrant),
43 43
                 'DbTable',
44
-                AbstractMaker::getClassName ( $constrant->getTable () )
44
+                AbstractMaker::getClassName($constrant->getTable())
45 45
             );
46
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
46
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
47 47
 
48
-            $references[] = sprintf (
48
+            $references[] = sprintf(
49 49
                 "
50 50
        '%s' => array (
51 51
             'columns'       => '%s' ,
52 52
             'refTableClass' => '%s',
53 53
             'refColumns'    =>'%s'
54 54
        )",
55
-                AbstractMaker::getClassName ( $constrant->getNameConstrant () ),
56
-                $objColumn->getName (),
55
+                AbstractMaker::getClassName($constrant->getNameConstrant()),
56
+                $objColumn->getName(),
57 57
                 $class,
58
-                $constrant->getColumn ()
58
+                $constrant->getColumn()
59 59
 
60 60
             );
61 61
         }
62 62
 
63
-        if ( sizeof ( $references ) > 0 )
63
+        if (sizeof($references) > 0)
64 64
         {
65 65
             $referenceMap = "protected \$_referenceMap = array(" .
66
-                join ( ',', $references ) . "\n    );";
66
+                join(',', $references) . "\n    );";
67 67
         }
68 68
 
69
-        foreach ( $dbTable->getDependences () as $objColumn )
69
+        foreach ($dbTable->getDependences() as $objColumn)
70 70
         {
71
-            foreach ( $objColumn->getDependences () as $dependence )
71
+            foreach ($objColumn->getDependences() as $dependence)
72 72
             {
73
-                $arrClass = array (
74
-                    $makerFile->getConfig ()->createClassNamespace ( $dependence ),
73
+                $arrClass = array(
74
+                    $makerFile->getConfig()->createClassNamespace($dependence),
75 75
                     'DbTable',
76
-                    AbstractMaker::getClassName ( $dependence->getTable () )
76
+                    AbstractMaker::getClassName($dependence->getTable())
77 77
                 );
78
-                $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
78
+                $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
79 79
 
80 80
                 $dependents[] = $class;
81 81
             }
82 82
         }
83 83
 
84
-        if ( sizeof ( $dependents ) > 0 )
84
+        if (sizeof($dependents) > 0)
85 85
         {
86 86
             $dependentTables = "protected \$_dependentTables = array(\n        '" .
87
-                join ( "',\n        '", $dependents ) . "'\n    );";
87
+                join("',\n        '", $dependents) . "'\n    );";
88 88
         }
89 89
 
90 90
 
91
-        return array (
91
+        return array(
92 92
             'referenceMap'    => $referenceMap,
93 93
             'dependentTables' => $dependentTables
94 94
         );
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/AbstractAdapter.php 3 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     /**
137 137
      * @param \Classes\Db\DbTable|\Classes\Db\Constrant $table
138 138
      *
139
-     * @return mixed
139
+     * @return string
140 140
      */
141 141
 
142 142
     public function createClassNamespace ( $table )
@@ -225,6 +225,9 @@  discard block
 block discarded – undo
225 225
         return true;
226 226
     }
227 227
 
228
+    /**
229
+     * @return string
230
+     */
228 231
     protected function getFrameworkIni ()
229 232
     {
230 233
         return $this->framworkFiles[ 'ini' ];
@@ -332,7 +335,6 @@  discard block
 block discarded – undo
332 335
     }
333 336
 
334 337
     /**
335
-     * @param string $schema
336 338
      *
337 339
      * @return string
338 340
      */
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,8 +134,7 @@
 block discarded – undo
134 134
             }
135 135
 
136 136
 
137
-        }
138
-        else {
137
+        } else {
139 138
             $url            = array (
140 139
                 $this->baseLocation,
141 140
                 $driverBase,
Please login to merge, or discard this patch.
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 abstract class AbstractAdapter
17 17
 {
18 18
 
19
-    protected $arrConfig = array (
19
+    protected $arrConfig = array(
20 20
         ############################# DATABASE
21 21
         //Driver do banco de dados
22 22
         'driver'          => null,
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         //senha do banco
32 32
         'password'        => null,
33 33
         // lista de schemas do banco de dados
34
-        'schema'          => array (),
34
+        'schema'          => array(),
35 35
         'version'         => '',
36 36
         'socket'          => null,
37 37
 
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
         // flags para criar todas as tabelas ou nao
65 65
         'allTables'       => true,
66 66
         //Lista de tabelas a serem ignoradas
67
-        'ignoreTable'     => array (),
67
+        'ignoreTable'     => array(),
68 68
     );
69 69
 
70 70
     /**
71 71
      * @var string[] um array com todos os campos obrigatorios
72 72
      */
73
-    protected $attRequered = array (
73
+    protected $attRequered = array(
74 74
         'driver'   => true,
75 75
         'database' => true,
76 76
         'host'     => true,
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
         'path'     => true
79 79
     );
80 80
 
81
-    protected $arrFunc = array ();
81
+    protected $arrFunc = array();
82 82
 
83
-    private $framworkFiles = array ();
83
+    private $framworkFiles = array();
84 84
 
85
-    public $reservedWord = array ();
85
+    public $reservedWord = array();
86 86
 
87 87
     const SEPARETOR = "";
88 88
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
      *
92 92
      * @return bool
93 93
      */
94
-    protected function checkConfig ()
94
+    protected function checkConfig()
95 95
     {
96
-        if ( array_diff_key ( $this->attRequered, array_filter ( $this->arrConfig ) ) ) {
96
+        if (array_diff_key($this->attRequered, array_filter($this->arrConfig))) {
97 97
             return false;
98 98
         }
99 99
 
@@ -105,33 +105,33 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @return array
107 107
      */
108
-    abstract protected function getParams ();
108
+    abstract protected function getParams();
109 109
 
110 110
     /**
111 111
      * Popula as config do generater com as configuraçoes do framework
112 112
      *
113 113
      * @return mixed
114 114
      */
115
-    abstract protected function parseFrameworkConfig ();
115
+    abstract protected function parseFrameworkConfig();
116 116
 
117 117
     /**
118 118
      * Cria Instancias dos arquivos que devem ser gerados
119 119
      *
120 120
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
121 121
      */
122
-    abstract public function getMakeFileInstances ();
122
+    abstract public function getMakeFileInstances();
123 123
 
124
-    abstract protected function init ();
124
+    abstract protected function init();
125 125
 
126 126
     /**
127 127
      * retorna a base do Namespace
128 128
      *
129 129
      * @return array
130 130
      */
131
-    protected function getBaseNamespace ()
131
+    protected function getBaseNamespace()
132 132
     {
133
-        return array (
134
-            $this->arrConfig[ 'namespace' ],
133
+        return array(
134
+            $this->arrConfig['namespace'],
135 135
             'Model'
136 136
         );
137 137
     }
@@ -142,48 +142,48 @@  discard block
 block discarded – undo
142 142
      * @return mixed
143 143
      */
144 144
 
145
-    public function createClassNamespace ( $table )
145
+    public function createClassNamespace($table)
146 146
     {
147
-        $arrNames = $this->getBaseNamespace ();
147
+        $arrNames = $this->getBaseNamespace();
148 148
 
149
-        if ( isset( $this->arrConfig[ 'folder-database' ] )
150
-             && $this->arrConfig[ 'folder-database' ]
149
+        if (isset($this->arrConfig['folder-database'])
150
+             && $this->arrConfig['folder-database']
151 151
         ) {
152
-            $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig[ 'driver' ] );
152
+            $arrNames[] = AbstractMaker::getClassName($this->arrConfig['driver']);
153 153
         }
154 154
 
155
-        if ( isset( $this->arrConfig[ 'folder-name' ] )
156
-             && $this->arrConfig[ 'folder-name' ]
155
+        if (isset($this->arrConfig['folder-name'])
156
+             && $this->arrConfig['folder-name']
157 157
         ) {
158
-            $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig[ 'folder-name' ] );
158
+            $arrNames[] = AbstractMaker::getClassName($this->arrConfig['folder-name']);
159 159
         }
160 160
 
161
-        if ( $table->hasSchema () ) {
162
-            $arrNames[] = $this->replaceReservedWord ( AbstractMaker::getClassName ( $table->getSchema () ) );
161
+        if ($table->hasSchema()) {
162
+            $arrNames[] = $this->replaceReservedWord(AbstractMaker::getClassName($table->getSchema()));
163 163
         }
164 164
         else {
165
-            $arrNames[] = $this->replaceReservedWord ( AbstractMaker::getClassName ( $table->getDatabase () ) );
165
+            $arrNames[] = $this->replaceReservedWord(AbstractMaker::getClassName($table->getDatabase()));
166 166
         }
167 167
 
168
-        return implode ( static::SEPARETOR, array_filter ( $arrNames ) );
168
+        return implode(static::SEPARETOR, array_filter($arrNames));
169 169
     }
170 170
 
171
-    public function __construct ( $array )
171
+    public function __construct($array)
172 172
     {
173
-        $array += array (
173
+        $array += array(
174 174
             'version'     => Config::$version,
175
-            'author'      => ucfirst ( get_current_user () ),
176
-            'last_modify' => date ( "d-m-Y H:i:s." )
175
+            'author'      => ucfirst(get_current_user()),
176
+            'last_modify' => date("d-m-Y H:i:s.")
177 177
         );
178 178
 
179
-        $this->setFrameworkFiles ( $array );
180
-        $this->parseFrameworkConfig ();
181
-        $this->setParams ( $this->getParams () );
182
-        $this->setParams ( $array );
183
-        $this->init ();
184
-        if ( !$this->isValid () ) {
185
-            $var = array_diff_key ( $this->attRequered, array_filter ( $this->arrConfig ) );
186
-            throw new Exception( $var );
179
+        $this->setFrameworkFiles($array);
180
+        $this->parseFrameworkConfig();
181
+        $this->setParams($this->getParams());
182
+        $this->setParams($array);
183
+        $this->init();
184
+        if ( ! $this->isValid()) {
185
+            $var = array_diff_key($this->attRequered, array_filter($this->arrConfig));
186
+            throw new Exception($var);
187 187
         }
188 188
     }
189 189
 
@@ -192,35 +192,35 @@  discard block
 block discarded – undo
192 192
      *
193 193
      * @param $array
194 194
      */
195
-    public function setFrameworkFiles ( $array )
195
+    public function setFrameworkFiles($array)
196 196
     {
197
-        $this->framworkFiles[ 'library' ] = isset( $array[ 'framework-path-library' ] ) ? $array[ 'framework-path-library' ] : null;
197
+        $this->framworkFiles['library'] = isset($array['framework-path-library']) ? $array['framework-path-library'] : null;
198 198
 
199
-        $this->framworkFiles[ 'ini' ] = isset( $array[ 'framework-ini' ] ) ? $array[ 'framework-ini' ] : null;
199
+        $this->framworkFiles['ini'] = isset($array['framework-ini']) ? $array['framework-ini'] : null;
200 200
 
201
-        $this->framworkFiles[ 'environment' ] = isset( $array[ 'environment' ] ) ? $array[ 'environment' ] : 'production';
201
+        $this->framworkFiles['environment'] = isset($array['environment']) ? $array['environment'] : 'production';
202 202
 
203 203
     }
204 204
 
205
-    protected function isValidFrameworkFiles ()
205
+    protected function isValidFrameworkFiles()
206 206
     {
207
-        if ( !is_file ( $this->framworkFiles[ 'ini' ] ) ) {
207
+        if ( ! is_file($this->framworkFiles['ini'])) {
208 208
             return false;
209 209
         }
210 210
 
211
-        if ( !is_dir ( $this->framworkFiles[ 'library' ] ) ) {
211
+        if ( ! is_dir($this->framworkFiles['library'])) {
212 212
             return false;
213 213
         }
214 214
 
215
-        if ( !isset ( $this->framworkFiles[ 'environment' ] ) or empty( $this->framworkFiles[ 'environment' ] ) ) {
215
+        if ( ! isset ($this->framworkFiles['environment']) or empty($this->framworkFiles['environment'])) {
216 216
             return false;
217 217
         }
218
-        set_include_path (
219
-            implode (
218
+        set_include_path(
219
+            implode(
220 220
                 PATH_SEPARATOR,
221
-                array (
222
-                    realpath ( $this->framworkFiles[ 'library' ] ),
223
-                    get_include_path (),
221
+                array(
222
+                    realpath($this->framworkFiles['library']),
223
+                    get_include_path(),
224 224
                 )
225 225
             )
226 226
         );
@@ -228,110 +228,110 @@  discard block
 block discarded – undo
228 228
         return true;
229 229
     }
230 230
 
231
-    protected function getFrameworkIni ()
231
+    protected function getFrameworkIni()
232 232
     {
233
-        return $this->framworkFiles[ 'ini' ];
233
+        return $this->framworkFiles['ini'];
234 234
     }
235 235
 
236
-    protected function getEnvironment ()
236
+    protected function getEnvironment()
237 237
     {
238
-        return $this->framworkFiles[ 'environment' ];
238
+        return $this->framworkFiles['environment'];
239 239
     }
240 240
 
241 241
     /**
242 242
      * Popula as variaveis de acordo com o arquivo de configuração do seu  framework
243 243
      */
244
-    protected function isValid ()
244
+    protected function isValid()
245 245
     {
246
-        return $this->checkConfig ();
246
+        return $this->checkConfig();
247 247
     }
248 248
 
249
-    private function setParams ( $array )
249
+    private function setParams($array)
250 250
     {
251
-        if ( count ( $array ) > 0 ) {
252
-            $this->arrConfig = array_filter ( $array ) + $this->arrConfig;
251
+        if (count($array) > 0) {
252
+            $this->arrConfig = array_filter($array) + $this->arrConfig;
253 253
         }
254 254
     }
255 255
 
256 256
     /**
257 257
      * @return string
258 258
      */
259
-    public function getDatabase ()
259
+    public function getDatabase()
260 260
     {
261
-        return $this->arrConfig[ 'database' ];
261
+        return $this->arrConfig['database'];
262 262
     }
263 263
 
264 264
     /**
265 265
      * @return bool
266 266
      */
267
-    public function hasSchemas ()
267
+    public function hasSchemas()
268 268
     {
269
-        return !empty ( $this->arrConfig[ 'schema' ] );
269
+        return ! empty ($this->arrConfig['schema']);
270 270
     }
271 271
 
272 272
     /**
273 273
      * @return string[]
274 274
      */
275
-    public function getSchemas ()
275
+    public function getSchemas()
276 276
     {
277
-        if ( is_string ( $this->arrConfig[ 'schema' ] ) ) {
278
-            return array ( $this->arrConfig[ 'schema' ] );
277
+        if (is_string($this->arrConfig['schema'])) {
278
+            return array($this->arrConfig['schema']);
279 279
         }
280 280
 
281
-        return $this->arrConfig[ 'schema' ];
281
+        return $this->arrConfig['schema'];
282 282
     }
283 283
 
284
-    public function setSchema ( $schema )
284
+    public function setSchema($schema)
285 285
     {
286
-        $this->arrConfig[ 'schema' ] = $schema;
286
+        $this->arrConfig['schema'] = $schema;
287 287
     }
288 288
 
289 289
     /**
290 290
      * @return string
291 291
      */
292
-    public function getHost ()
292
+    public function getHost()
293 293
     {
294
-        return $this->arrConfig[ 'host' ];
294
+        return $this->arrConfig['host'];
295 295
     }
296 296
 
297 297
     /**
298 298
      * @return int
299 299
      */
300
-    public function getPort ()
300
+    public function getPort()
301 301
     {
302
-        return $this->arrConfig[ 'port' ];
302
+        return $this->arrConfig['port'];
303 303
     }
304 304
 
305 305
     /**
306 306
      * @return boolean
307 307
      */
308
-    public function hasPort ()
308
+    public function hasPort()
309 309
     {
310
-        return !empty( $this->arrConfig[ 'port' ] );
310
+        return ! empty($this->arrConfig['port']);
311 311
     }
312 312
 
313 313
     /**
314 314
      * @return string
315 315
      */
316
-    public function getSocket ()
316
+    public function getSocket()
317 317
     {
318
-        return $this->arrConfig[ 'socket' ];
318
+        return $this->arrConfig['socket'];
319 319
     }
320 320
 
321 321
     /**
322 322
      * @return string
323 323
      */
324
-    public function getUser ()
324
+    public function getUser()
325 325
     {
326
-        return $this->arrConfig[ 'username' ];
326
+        return $this->arrConfig['username'];
327 327
     }
328 328
 
329 329
     /**
330 330
      * @return string
331 331
      */
332
-    public function getPassword ()
332
+    public function getPassword()
333 333
     {
334
-        return $this->arrConfig[ 'password' ];
334
+        return $this->arrConfig['password'];
335 335
     }
336 336
 
337 337
     /**
@@ -339,10 +339,10 @@  discard block
 block discarded – undo
339 339
      *
340 340
      * @return string
341 341
      */
342
-    public function replaceReservedWord ( $palavra )
342
+    public function replaceReservedWord($palavra)
343 343
     {
344
-        if ( isset( $this->reservedWord[ strtolower ( $palavra ) ] ) ) {
345
-            return $this->reservedWord[ strtolower ( $palavra ) ];
344
+        if (isset($this->reservedWord[strtolower($palavra)])) {
345
+            return $this->reservedWord[strtolower($palavra)];
346 346
         }
347 347
 
348 348
         return $palavra;
@@ -351,9 +351,9 @@  discard block
 block discarded – undo
351 351
     /**
352 352
      * @return bool
353 353
      */
354
-    public function isStatusEnabled ()
354
+    public function isStatusEnabled()
355 355
     {
356
-        return (bool) $this->arrConfig[ 'status' ];
356
+        return (bool) $this->arrConfig['status'];
357 357
     }
358 358
 
359 359
     /**
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
      *
362 362
      * @return string
363 363
      */
364
-    public function __get ( $str )
364
+    public function __get($str)
365 365
     {
366
-        $arr = array (
366
+        $arr = array(
367 367
             'namespace',
368 368
             'framework',
369 369
             'author',
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
             'folder-name'
378 378
         );
379 379
 
380
-        if ( in_array ( $str, $arr ) ) {
381
-            return $this->arrConfig[ strtolower ( $str ) ];
380
+        if (in_array($str, $arr)) {
381
+            return $this->arrConfig[strtolower($str)];
382 382
         }
383 383
 
384 384
         return;
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/Phalcon/Entity.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 '$this->belongsTo(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
55 55
                 $objColumn->getName (),
56 56
                 $makerFile->getConfig ()
57
-                          ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
57
+                            ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
58 58
                     $constrant->getTable ()
59 59
                 ),
60 60
                 $constrant->getColumn (),
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     '$this->hasMany(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
87 87
                     $objColumn->getName (),
88 88
                     $makerFile->getConfig ()
89
-                              ->createClassNamespace ( $dependence )
89
+                                ->createClassNamespace ( $dependence )
90 90
                     . Phalcon::SEPARETOR
91 91
                     . AbstractMaker::getClassName ( $dependence->getTable () ),
92 92
                     $dependence->getColumn (),
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     protected $fileTpl   = "entity.php";
21 21
     protected $overwrite = true;
22 22
 
23
-    protected $validFunc = array ();
23
+    protected $validFunc = array();
24 24
 
25 25
     private $intersectDependence = false;
26 26
 
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return array
32 32
      */
33
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
33
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
34 34
     {
35
-        return array (
36
-            'mapParents'    => $this->listParents ( $makerFile, $dbTable ),
37
-            'mapDependents' => $this->listDependence ( $makerFile, $dbTable )
35
+        return array(
36
+            'mapParents'    => $this->listParents($makerFile, $dbTable),
37
+            'mapDependents' => $this->listDependence($makerFile, $dbTable)
38 38
         );
39 39
     }
40 40
 
@@ -44,26 +44,26 @@  discard block
 block discarded – undo
44 44
      *
45 45
      * @return array
46 46
      */
47
-    private function listParents ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
47
+    private function listParents(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
48 48
     {
49 49
         $mapParents = '';
50
-        $references = array ();
51
-        foreach ( $dbTable->getForeingkeys () as $objColumn ) {
52
-            $constrant    = $objColumn->getFks ();
53
-            $references[] = sprintf (
50
+        $references = array();
51
+        foreach ($dbTable->getForeingkeys() as $objColumn) {
52
+            $constrant    = $objColumn->getFks();
53
+            $references[] = sprintf(
54 54
                 '$this->belongsTo(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
55
-                $objColumn->getName (),
56
-                $makerFile->getConfig ()
57
-                          ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
58
-                    $constrant->getTable ()
55
+                $objColumn->getName(),
56
+                $makerFile->getConfig()
57
+                          ->createClassNamespace($constrant) . Phalcon::SEPARETOR . AbstractMaker::getClassName(
58
+                    $constrant->getTable()
59 59
                 ),
60
-                $constrant->getColumn (),
61
-                AbstractMaker::getClassName ( $constrant->getTable () )
60
+                $constrant->getColumn(),
61
+                AbstractMaker::getClassName($constrant->getTable())
62 62
             );
63 63
         }
64 64
 
65
-        if ( sizeof ( $references ) > 0 ) {
66
-            $mapParents = join ( ";\n\t\t", $references ) . ";\n";
65
+        if (sizeof($references) > 0) {
66
+            $mapParents = join(";\n\t\t", $references) . ";\n";
67 67
         }
68 68
 
69 69
 
@@ -76,28 +76,28 @@  discard block
 block discarded – undo
76 76
      *
77 77
      * @return array
78 78
      */
79
-    private function listDependence ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
79
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
80 80
     {
81 81
         $mapDependence = '';
82
-        $references    = array ();
83
-        foreach ( $dbTable->getDependences () as $objColumn ) {
84
-            foreach ( $objColumn->getDependences () as $dependence ) {
85
-                $references[] = sprintf (
82
+        $references    = array();
83
+        foreach ($dbTable->getDependences() as $objColumn) {
84
+            foreach ($objColumn->getDependences() as $dependence) {
85
+                $references[] = sprintf(
86 86
                     '$this->hasMany(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
87
-                    $objColumn->getName (),
88
-                    $makerFile->getConfig ()
89
-                              ->createClassNamespace ( $dependence )
87
+                    $objColumn->getName(),
88
+                    $makerFile->getConfig()
89
+                              ->createClassNamespace($dependence)
90 90
                     . Phalcon::SEPARETOR
91
-                    . AbstractMaker::getClassName ( $dependence->getTable () ),
92
-                    $dependence->getColumn (),
93
-                    AbstractMaker::getClassName ( $dependence->getTable () )
91
+                    . AbstractMaker::getClassName($dependence->getTable()),
92
+                    $dependence->getColumn(),
93
+                    AbstractMaker::getClassName($dependence->getTable())
94 94
                 );
95 95
 
96 96
             }
97 97
         }
98 98
 
99
-        if ( sizeof ( $references ) > 0 ) {
100
-            $mapDependence = join ( ";\n\t\t", $references ) . ";";
99
+        if (sizeof($references) > 0) {
100
+            $mapDependence = join(";\n\t\t", $references) . ";";
101 101
         }
102 102
 
103 103
         return $mapDependence;
Please login to merge, or discard this patch.
build/Classes/Config.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
         $configIni = isset( $argv[ 'config-ini' ] )
136 136
             ? $argv[ 'config-ini' ]
137 137
             : $this->_basePath
138
-              . $this->configIniDefault;
138
+                . $this->configIniDefault;
139 139
 
140 140
         $configTemp    = $this->loadIniFile ( realpath ( $configIni ) );
141 141
         $configCurrent = self::parseConfigEnv ( $configTemp, $argv );
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     /**
53 53
      * @var array
54 54
      */
55
-    private $argv = array ();
55
+    private $argv = array();
56 56
 
57 57
     /**
58 58
      * @var \Classes\AdapterConfig\AbstractAdapter
@@ -64,22 +64,22 @@  discard block
 block discarded – undo
64 64
      */
65 65
     private $adapterDriver;
66 66
 
67
-    private $frameworkList = array (
67
+    private $frameworkList = array(
68 68
         'none',
69 69
         'zf1',
70 70
         'phalcon'
71 71
     );
72 72
 
73
-    public function __construct ( $argv, $basePath )
73
+    public function __construct($argv, $basePath)
74 74
     {
75
-        if ( array_key_exists ( 'help', $argv ) ) {
76
-            die ( $this->getUsage () );
75
+        if (array_key_exists('help', $argv)) {
76
+            die ($this->getUsage());
77 77
         }
78
-        if ( array_key_exists ( 'status', $argv ) ) {
79
-            $argv[ 'status' ] = true;
78
+        if (array_key_exists('status', $argv)) {
79
+            $argv['status'] = true;
80 80
         }
81 81
 
82
-        $this->argv = $this->parseConfig ( $basePath, $argv );
82
+        $this->argv = $this->parseConfig($basePath, $argv);
83 83
     }
84 84
 
85 85
     /**
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
      *
88 88
      * @return string
89 89
      */
90
-    public function getUsage ()
90
+    public function getUsage()
91 91
     {
92
-        $version = $this->getVersion ();
92
+        $version = $this->getVersion();
93 93
 
94 94
         return <<<EOF
95 95
 parameters:
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 EOF;
113 113
     }
114 114
 
115
-    public function getVersion ()
115
+    public function getVersion()
116 116
     {
117 117
         $version = static::$version;
118 118
 
@@ -128,28 +128,28 @@  discard block
 block discarded – undo
128 128
      * @return array
129 129
      * @throws \Exception
130 130
      */
131
-    private function parseConfig ( $basePath, $argv )
131
+    private function parseConfig($basePath, $argv)
132 132
     {
133
-        $this->_basePath = dirname ( $basePath );
133
+        $this->_basePath = dirname($basePath);
134 134
 
135
-        $configIni = isset( $argv[ 'config-ini' ] )
136
-            ? $argv[ 'config-ini' ]
135
+        $configIni = isset($argv['config-ini'])
136
+            ? $argv['config-ini']
137 137
             : $this->_basePath
138 138
               . $this->configIniDefault;
139 139
 
140
-        $configTemp    = $this->loadIniFile ( realpath ( $configIni ) );
141
-        $configCurrent = self::parseConfigEnv ( $configTemp, $argv );
140
+        $configTemp    = $this->loadIniFile(realpath($configIni));
141
+        $configCurrent = self::parseConfigEnv($configTemp, $argv);
142 142
 
143
-        if ( !isset( $configCurrent[ 'framework' ] ) ) {
144
-            throw new \Exception( "configure which framework you want to use! \n" );
143
+        if ( ! isset($configCurrent['framework'])) {
144
+            throw new \Exception("configure which framework you want to use! \n");
145 145
         }
146 146
 
147
-        if ( !in_array ( $configCurrent[ 'framework' ], $this->frameworkList ) ) {
148
-            $frameworks = implode ( "\n\t", $this->frameworkList );
149
-            throw new \Exception( "list of frameworks: \n\t\033[1;33m" . $frameworks . "\n\033[0m" );
147
+        if ( ! in_array($configCurrent['framework'], $this->frameworkList)) {
148
+            $frameworks = implode("\n\t", $this->frameworkList);
149
+            throw new \Exception("list of frameworks: \n\t\033[1;33m" . $frameworks . "\n\033[0m");
150 150
         }
151 151
 
152
-        return $argv + array_filter ( $configCurrent );
152
+        return $argv + array_filter($configCurrent);
153 153
     }
154 154
 
155 155
     /**
@@ -159,20 +159,20 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * @return string
161 161
      */
162
-    private static function parseConfigEnv ( $configTemp, $argv )
162
+    private static function parseConfigEnv($configTemp, $argv)
163 163
     {
164
-        $thisSection = isset( $configTemp[ key ( $configTemp ) ][ 'config-env' ] ) ? $configTemp[ key (
164
+        $thisSection = isset($configTemp[key($configTemp)]['config-env']) ? $configTemp[key(
165 165
             $configTemp
166
-        ) ][ 'config-env' ] : null;
166
+        )]['config-env'] : null;
167 167
 
168
-        $thisSection = isset( $argv[ 'config-env' ] ) ? $argv[ 'config-env' ] : $thisSection;
168
+        $thisSection = isset($argv['config-env']) ? $argv['config-env'] : $thisSection;
169 169
 
170
-        if ( isset( $configTemp[ $thisSection ][ 'extends' ] ) ) {
170
+        if (isset($configTemp[$thisSection]['extends'])) {
171 171
             #faz marge da config principal com a config extendida
172
-            return $configTemp[ $thisSection ] + $configTemp[ $configTemp[ $thisSection ][ 'extends' ] ];
172
+            return $configTemp[$thisSection] + $configTemp[$configTemp[$thisSection]['extends']];
173 173
         }
174 174
 
175
-        return $configTemp[ key ( $configTemp ) ];
175
+        return $configTemp[key($configTemp)];
176 176
     }
177 177
 
178 178
     /**
@@ -186,29 +186,29 @@  discard block
 block discarded – undo
186 186
      * @throws \Exception
187 187
      * @return array
188 188
      */
189
-    protected function loadIniFile ( $filename )
189
+    protected function loadIniFile($filename)
190 190
     {
191
-        if ( !is_file ( $filename ) ) {
192
-            throw new \Exception( "configuration file does not exist! \n" );
191
+        if ( ! is_file($filename)) {
192
+            throw new \Exception("configuration file does not exist! \n");
193 193
         }
194 194
 
195
-        $loaded   = parse_ini_file ( $filename, true );
196
-        $iniArray = array ();
197
-        foreach ( $loaded as $key => $data ) {
198
-            $pieces      = explode ( $this->sectionSeparator, $key );
199
-            $thisSection = trim ( $pieces[ 0 ] );
200
-            switch ( count ( $pieces ) ) {
195
+        $loaded   = parse_ini_file($filename, true);
196
+        $iniArray = array();
197
+        foreach ($loaded as $key => $data) {
198
+            $pieces      = explode($this->sectionSeparator, $key);
199
+            $thisSection = trim($pieces[0]);
200
+            switch (count($pieces)) {
201 201
                 case 1:
202
-                    $iniArray[ $thisSection ] = $data;
202
+                    $iniArray[$thisSection] = $data;
203 203
                     break;
204 204
 
205 205
                 case 2:
206
-                    $extendedSection          = trim ( $pieces[ 1 ] );
207
-                    $iniArray[ $thisSection ] = array_merge ( array ( 'extends' => $extendedSection ), $data );
206
+                    $extendedSection          = trim($pieces[1]);
207
+                    $iniArray[$thisSection] = array_merge(array('extends' => $extendedSection), $data);
208 208
                     break;
209 209
 
210 210
                 default:
211
-                    throw new \Exception( "Section '$thisSection' may not extend multiple sections in $filename" );
211
+                    throw new \Exception("Section '$thisSection' may not extend multiple sections in $filename");
212 212
             }
213 213
         }
214 214
 
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
      * @return \Classes\AdapterConfig\AbstractAdapter
222 222
      *
223 223
      */
224
-    private function factoryConfig ()
224
+    private function factoryConfig()
225 225
     {
226
-        switch ( strtolower ( $this->argv[ 'framework' ] ) ) {
226
+        switch (strtolower($this->argv['framework'])) {
227 227
             case 'zf1':
228
-                return new ZendFrameworkOne( $this->argv );
228
+                return new ZendFrameworkOne($this->argv);
229 229
             case 'phalcon':
230
-                return new Phalcon( $this->argv );
230
+                return new Phalcon($this->argv);
231 231
             default:
232
-                return new None( $this->argv );
232
+                return new None($this->argv);
233 233
         }
234 234
 
235 235
     }
@@ -241,31 +241,31 @@  discard block
 block discarded – undo
241 241
      *
242 242
      * @return AdaptersDriver\AbsractAdapter
243 243
      */
244
-    private function factoryDriver ( AdapterConfig\AbstractAdapter $config )
244
+    private function factoryDriver(AdapterConfig\AbstractAdapter $config)
245 245
     {
246
-        switch ( $this->argv[ 'driver' ] ) {
246
+        switch ($this->argv['driver']) {
247 247
             case 'pgsql':
248 248
             case 'pdo_pgsql':
249
-                return new Pgsql( $config );
249
+                return new Pgsql($config);
250 250
             case 'mysql':
251 251
             case 'pdo_mysql':
252
-                return new Mysql( $config );
252
+                return new Mysql($config);
253 253
             case 'mssql':
254
-                return new Mssql( $config );
254
+                return new Mssql($config);
255 255
             case 'dblib':
256
-                return new Dblib( $config );
256
+                return new Dblib($config);
257 257
             case 'sqlsrv':
258
-                return new Sqlsrv( $config );
258
+                return new Sqlsrv($config);
259 259
         }
260 260
     }
261 261
 
262 262
     /**
263 263
      * @return AdapterConfig\AbstractAdapter
264 264
      */
265
-    public function getAdapterConfig ()
265
+    public function getAdapterConfig()
266 266
     {
267
-        if ( !$this->adapterConfig instanceof AbstractAdapter ) {
268
-            $this->adapterConfig = $this->factoryConfig ();
267
+        if ( ! $this->adapterConfig instanceof AbstractAdapter) {
268
+            $this->adapterConfig = $this->factoryConfig();
269 269
         }
270 270
 
271 271
         return $this->adapterConfig;
@@ -274,10 +274,10 @@  discard block
 block discarded – undo
274 274
     /**
275 275
      * @return AdaptersDriver\AbsractAdapter
276 276
      */
277
-    public function getAdapterDriver ( AdapterConfig\AbstractAdapter $config )
277
+    public function getAdapterDriver(AdapterConfig\AbstractAdapter $config)
278 278
     {
279
-        if ( !$this->adapterDriver ) {
280
-            $this->adapterDriver = $this->factoryDriver ( $config );
279
+        if ( ! $this->adapterDriver) {
280
+            $this->adapterDriver = $this->factoryDriver($config);
281 281
         }
282 282
 
283 283
         return $this->adapterDriver;
Please login to merge, or discard this patch.
build/Classes/AdapterConfig/Phalcon.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@  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 27
     const SEPARETOR = "\\";
28 28
 
29
-    protected function init ()
29
+    protected function init()
30 30
     {
31 31
     }
32 32
 
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
      *
36 36
      * @return array
37 37
      */
38
-    protected function getParams ()
38
+    protected function getParams()
39 39
     {
40 40
 
41 41
     }
42 42
 
43
-    protected function parseFrameworkConfig ()
43
+    protected function parseFrameworkConfig()
44 44
     {
45 45
         // TODO: Implement parseFrameworkConfig() method.
46 46
     }
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
     /**
49 49
      * @inheritdoc
50 50
      */
51
-    protected function getBaseNamespace ()
51
+    protected function getBaseNamespace()
52 52
     {
53
-        return array (
54
-            $this->arrConfig[ 'namespace' ],
53
+        return array(
54
+            $this->arrConfig['namespace'],
55 55
             'Models'
56 56
         );
57 57
     }
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
      *
62 62
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
63 63
      */
64
-    public function getMakeFileInstances ()
64
+    public function getMakeFileInstances()
65 65
     {
66
-        return array (
67
-            Entity::getInstance (),
68
-            Model::getInstance (),
69
-            Peer::getInstance ()
66
+        return array(
67
+            Entity::getInstance(),
68
+            Model::getInstance(),
69
+            Peer::getInstance()
70 70
         );
71 71
     }
72 72
 
Please login to merge, or discard this patch.
build/Classes/templates/phalcon/model.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 block discarded – undo
3 3
 /**
4 4
  * Data Model implementation for this class
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8
- * @see  <?=$objTables->getNamespace()?>\<?=$this->getClassName ( $objTables->getName () ). "\n"?>
8
+ * @see  <?=$objTables->getNamespace()?>\<?=$this->getClassName($objTables->getName()) . "\n"?>
9 9
  *
10
- * @author    <?=$this->config->author."\n"?>
10
+ * @author    <?=$this->config->author . "\n"?>
11 11
  *
12
- * @copyright <?=$this->config->copyright."\n"?>
13
- * @license   <?=$this->config->license."\n"?>
14
- * @link      <?=$this->config->link."\n"?>
15
- * @version   <?=$this->config->version."\n"?>
12
+ * @copyright <?=$this->config->copyright . "\n"?>
13
+ * @license   <?=$this->config->license . "\n"?>
14
+ * @link      <?=$this->config->link . "\n"?>
15
+ * @version   <?=$this->config->version . "\n"?>
16 16
  */
17 17
 
18 18
 
19 19
 namespace <?=$objTables->getNamespace()?>;
20 20
 
21
-class <?=$this->getClassName ( $objTables->getName () )?> extends \<?=$objTables->getNamespace()?>\Entity\<?=$this->getClassName ( $objTables->getName () ). "\n"?>
21
+class <?=$this->getClassName($objTables->getName())?> extends \<?=$objTables->getNamespace()?>\Entity\<?=$this->getClassName($objTables->getName()) . "\n"?>
22 22
 {
23 23
        /* @TODO Codifique aqui */
24 24
 }
Please login to merge, or discard this patch.
build/Classes/templates/phalcon/entity.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -3,43 +3,43 @@  discard block
 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   <?=$objTables->getNamespace()?>\Entity
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 18
 namespace  <?=$objTables->getNamespace()?>\Entity;
19 19
 
20 20
 use Phalcon\Validation;
21 21
 
22
-abstract class <?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?> extends \Phalcon\Mvc\Model
22
+abstract class <?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?> extends \Phalcon\Mvc\Model
23 23
 {
24 24
 
25 25
 <?php foreach ($objTables->getColumns() as $column): ?>
26 26
     /**
27
-    * column <?=$column->getName()."\n"?>
27
+    * column <?=$column->getName() . "\n"?>
28 28
     *
29
-<?php if($column->isPrimaryKey()):?>
29
+<?php if ($column->isPrimaryKey()):?>
30 30
     * @Primary
31 31
 <?php endif ?>
32
-<?php if($column->hasSequence()):?>
32
+<?php if ($column->hasSequence()):?>
33 33
     * @Identity
34 34
 <?php endif ?>
35
-    * @Column(type="<?=$column->getType()?>", nullable=<?=$column->isNullable () ? "true" : "false"?><?php
36
-if ( $column->getMaxLength () ): ?>
37
-, length=<?=$column->getMaxLength ()?>
35
+    * @Column(type="<?=$column->getType()?>", nullable=<?=$column->isNullable() ? "true" : "false"?><?php
36
+if ($column->getMaxLength()): ?>
37
+, length=<?=$column->getMaxLength()?>
38 38
 <?php endif ?>)
39 39
     */
40 40
     protected $<?=$column->getName()?>;
41 41
 
42
-<?php endforeach;?>
42
+<?php endforeach; ?>
43 43
     /**
44 44
      * Validations and business logic
45 45
      *
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
         $validator = new Validation();
51 51
 
52 52
 <?php foreach ($objTables->getColumns() as $column): ?>
53
-<?php if(strtolower($column->getName()) == 'email'):?>
53
+<?php if (strtolower($column->getName()) == 'email'):?>
54 54
         $validator->add(
55 55
             'email',
56 56
             new \Phalcon\Validation\Validator\Email()
57 57
         );
58 58
 
59 59
 <?php endif ?>
60
-<?php endforeach;?>
60
+<?php endforeach; ?>
61 61
         return $this->validate($validator);
62 62
     }
63 63
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function initialize()
68 68
     {
69
-        <?=$mapDependents."\n"?>
70
-        <?=$mapParents."\n"?>
69
+        <?=$mapDependents . "\n"?>
70
+        <?=$mapParents . "\n"?>
71 71
     }
72 72
 
73
-<?php if($objTables->hasSchema()): ?>
73
+<?php if ($objTables->hasSchema()): ?>
74 74
     /**
75 75
      * Returns schema name where table mapped is located
76 76
      *
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
         return '<?=$objTables->getName()?>';
93 93
     }
94 94
 
95
-<?php if( $objTables->hasSequences() ) : ?>
95
+<?php if ($objTables->hasSequences()) : ?>
96 96
     public function getSequenceName()
97 97
     {
98
-<?php if ( 1 ==  count($objTables->getSequences() ) ) : ?>
99
-    <?php $seqs = $objTables->getSequences();reset($seqs);$seq = current($seqs);?>
98
+<?php if (1 == count($objTables->getSequences())) : ?>
99
+    <?php $seqs = $objTables->getSequences(); reset($seqs); $seq = current($seqs); ?>
100 100
         return "<?=$seq->getSequence() ?>";
101 101
 <?php endif ?>
102 102
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * Allows to query a set of records that match the specified conditions
107 107
      *
108 108
      * @param mixed $parameters
109
-     * @return \<?=$objTables->getNamespace()?>\<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?>[]
109
+     * @return \<?=$objTables->getNamespace()?>\<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?>[]
110 110
      */
111 111
     public static function find($parameters = null)
112 112
     {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      * Allows to query the first record that match the specified conditions
118 118
      *
119 119
      * @param mixed $parameters
120
-     * @return \<?=$objTables->getNamespace()?>\<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )."\n"?>
120
+     * @return \<?=$objTables->getNamespace()?>\<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName()) . "\n"?>
121 121
      */
122 122
     public static function findFirst($parameters = null)
123 123
     {
@@ -126,17 +126,17 @@  discard block
 block discarded – undo
126 126
 
127 127
 
128 128
 <?php foreach ($objTables->getColumns() as $column): ?>
129
-    public function set<?=$this->getClassName ( $column->getName () )?>( $<?=$column->getName()?> )
129
+    public function set<?=$this->getClassName($column->getName())?>( $<?=$column->getName()?> )
130 130
     {
131 131
         $this-><?=$column->getName()?> = $<?=$column->getName()?>;
132 132
     }
133 133
 
134 134
     /**
135
-    * @return <?=$column->getType ()."\n" ?>
135
+    * @return <?=$column->getType() . "\n" ?>
136 136
     **/
137
-    public function get<?=$this->getClassName ( $column->getName () )?>()
137
+    public function get<?=$this->getClassName($column->getName())?>()
138 138
     {
139
-        return (<?=$column->getType () ?>) $this-><?=$column->getName()?>;
139
+        return (<?=$column->getType() ?>) $this-><?=$column->getName()?>;
140 140
     }
141
-<?php endforeach;?>
141
+<?php endforeach; ?>
142 142
 }
143 143
\ No newline at end of file
Please login to merge, or discard this patch.