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 (#18)
by Pedro
04:43
created
build/Classes/AdaptersDriver/Mysql.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -30,28 +30,28 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return string
32 32
      */
33
-    protected function convertTypeToSimple ( $str )
33
+    protected function convertTypeToSimple($str)
34 34
     {
35 35
         $res = '';
36
-        if ( preg_match ( '/(tinyint\(1\)|bit)/', $str ) ) {
36
+        if (preg_match('/(tinyint\(1\)|bit)/', $str)) {
37 37
             $res = 'boolean';
38 38
         }
39
-        elseif ( preg_match ( '/(timestamp|blob|char|enum)/', $str ) ) {
39
+        elseif (preg_match('/(timestamp|blob|char|enum)/', $str)) {
40 40
             $res = 'string';
41 41
         }
42
-        elseif ( preg_match ( '/(text)/', $str ) ) {
42
+        elseif (preg_match('/(text)/', $str)) {
43 43
             $res = 'text';
44 44
         }
45
-        elseif ( preg_match ( '/(decimal|numeric|float|double)/', $str ) ) {
45
+        elseif (preg_match('/(decimal|numeric|float|double)/', $str)) {
46 46
             $res = 'float';
47 47
         }
48
-        elseif ( preg_match ( '#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches ) ) {
49
-            $res = $matches[ 1 ];
48
+        elseif (preg_match('#^(?:tiny|small|medium|long|big|var)?(\w+)(?:\(\d+\))?(?:\s\w+)*$#', $str, $matches)) {
49
+            $res = $matches[1];
50 50
         }
51
-        elseif ( preg_match ( '/(date)/', $str ) ) {
51
+        elseif (preg_match('/(date)/', $str)) {
52 52
             $res = 'date';
53 53
         }
54
-        elseif ( preg_match ( '/(datetime)/', $str ) ) {
54
+        elseif (preg_match('/(datetime)/', $str)) {
55 55
             $res = 'datetime';
56 56
         }
57 57
         else {
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
      * @inheritDoc
66 66
      * @return string
67 67
      */
68
-    public function getPDOString ()
68
+    public function getPDOString()
69 69
     {
70
-        return sprintf (
70
+        return sprintf(
71 71
             "mysql:host=%s;port=%s;dbname=%s",
72 72
             $this->host,
73 73
             $this->port,
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
      * @inheritDoc
81 81
      * @return string
82 82
      */
83
-    public function getPDOSocketString ()
83
+    public function getPDOSocketString()
84 84
     {
85
-        return sprintf (
85
+        return sprintf(
86 86
             "mysql:unix_socket=%s;dbname=%s",
87 87
             $this->socket,
88 88
             $this->database
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
      * @inheritDoc
95 95
      * @return string[]
96 96
      */
97
-    public function getListNameTable ()
97
+    public function getListNameTable()
98 98
     {
99
-        if ( empty( $this->tableList ) ) {
100
-            $this->tableList = $this->getPDO ()
101
-                                    ->query (
99
+        if (empty($this->tableList)) {
100
+            $this->tableList = $this->getPDO()
101
+                                    ->query(
102 102
                                         "show tables"
103 103
                                     )
104
-                                    ->fetchAll ();
104
+                                    ->fetchAll();
105 105
         }
106 106
 
107 107
         return $this->tableList;
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
      *
113 113
      * @return array[]
114 114
      */
115
-    public function getListColumns ()
115
+    public function getListColumns()
116 116
     {
117
-        $sqlTables = !empty($this->tablesName)?"AND table_name IN ( $this->tablesName )":'';
117
+        $sqlTables = ! empty($this->tablesName) ? "AND table_name IN ( $this->tablesName )" : '';
118 118
 
119
-        return $this->getPDO ()
120
-                    ->query (
119
+        return $this->getPDO()
120
+                    ->query(
121 121
                         "select
122 122
                 0 AS table_schema,
123 123
                 table_name,
@@ -129,18 +129,18 @@  discard block
 block discarded – undo
129 129
             where table_schema IN ('{$this->database}') $sqlTables
130 130
             order by table_name,ordinal_position"
131 131
                     )
132
-                    ->fetchAll ( \PDO::FETCH_ASSOC );
132
+                    ->fetchAll(\PDO::FETCH_ASSOC);
133 133
     }
134 134
 
135 135
     /**
136 136
      * @return array
137 137
      */
138
-    public function getListConstrant ()
138
+    public function getListConstrant()
139 139
     {
140
-        $sqlTables = !empty($this->tablesName)?"AND k.table_name IN ( $this->tablesName )":'';
140
+        $sqlTables = ! empty($this->tablesName) ? "AND k.table_name IN ( $this->tablesName )" : '';
141 141
 
142
-        $objQuery = $this->getPDO ()
143
-                    ->query (
142
+        $objQuery = $this->getPDO()
143
+                    ->query(
144 144
                         "SELECT distinct
145 145
      i.constraint_type,
146 146
      k.constraint_name,
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 i.TABLE_SCHEMA IN ('{$this->database}') AND i.CONSTRAINT_TYPE IN ('FOREIGN KEY', 'PRIMARY KEY' ) $sqlTables
160 160
 order by k.table_schema, k.table_name;"
161 161
                     );
162
-        return $objQuery?$objQuery->fetchAll ( \PDO::FETCH_ASSOC ):array();
162
+        return $objQuery ? $objQuery->fetchAll(\PDO::FETCH_ASSOC) : array();
163 163
     }
164 164
 
165 165
     /**
@@ -167,17 +167,17 @@  discard block
 block discarded – undo
167 167
      *
168 168
      * @return int
169 169
      */
170
-    public function getTotalTables ()
170
+    public function getTotalTables()
171 171
     {
172
-        if ( empty( $this->totalTables ) ) {
172
+        if (empty($this->totalTables)) {
173 173
 
174
-            $sqlTables = !empty($this->tablesName)?"AND table_name IN ( $this->tablesName )":'';
174
+            $sqlTables = ! empty($this->tablesName) ? "AND table_name IN ( $this->tablesName )" : '';
175 175
 
176
-            $this->totalTables = $this->getPDO ()
177
-                                      ->query (
176
+            $this->totalTables = $this->getPDO()
177
+                                      ->query(
178 178
                                           "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{$this->database}' $sqlTables"
179 179
                                       )
180
-                                      ->fetchColumn ();
180
+                                      ->fetchColumn();
181 181
         }
182 182
 
183 183
         return (int) $this->totalTables;
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
      *
192 192
      * @return string
193 193
      */
194
-    public function getSequence ( $table, $column, $schema = 0 )
194
+    public function getSequence($table, $column, $schema = 0)
195 195
     {
196
-        $return = $this->getPDO ()
197
-                       ->query (
196
+        $return = $this->getPDO()
197
+                       ->query(
198 198
                            "select * from information_schema.columns where extra like '%auto_increment%' and  TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';"
199 199
                        )
200
-                       ->fetch ( \PDO::FETCH_ASSOC );
200
+                       ->fetch(\PDO::FETCH_ASSOC);
201 201
 
202
-        if ( !$return ) {
202
+        if ( ! $return) {
203 203
             return;
204 204
         }
205 205
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/Phalcon/Entity.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 
16 16
     public    $pastName      = 'Entity';
17 17
     protected $fileTpl       = "entity.php";
18
-    protected $fileFixedData = array (
19
-        'parentclass' => array (
20
-            'name' => "AbstractEntity" ,
18
+    protected $fileFixedData = array(
19
+        'parentclass' => array(
20
+            'name' => "AbstractEntity",
21 21
             'tpl'  => "entity_abstract.php"
22 22
         )
23 23
     );
24 24
 
25
-    protected $overwrite     = true;
25
+    protected $overwrite = true;
26 26
 
27
-    protected $validFunc = array ();
27
+    protected $validFunc = array();
28 28
 
29 29
     private $intersectDependence = false;
30 30
 
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
      *
35 35
      * @return array
36 36
      */
37
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
37
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
38 38
     {
39
-        return array (
40
-            'mapParents'    => $this->listParents ( $makerFile, $dbTable ),
41
-            'mapDependents' => $this->listDependence ( $makerFile, $dbTable )
39
+        return array(
40
+            'mapParents'    => $this->listParents($makerFile, $dbTable),
41
+            'mapDependents' => $this->listDependence($makerFile, $dbTable)
42 42
         );
43 43
     }
44 44
 
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return array
50 50
      */
51
-    private function listParents ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
51
+    private function listParents(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
52 52
     {
53 53
         $mapParents = '';
54
-        $references = array ();
55
-        foreach ( $dbTable->getForeingkeys () as $objColumn ) {
56
-            $constrant    = $objColumn->getFks ();
57
-            $references[] = sprintf (
54
+        $references = array();
55
+        foreach ($dbTable->getForeingkeys() as $objColumn) {
56
+            $constrant    = $objColumn->getFks();
57
+            $references[] = sprintf(
58 58
                 '$this->belongsTo(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
59
-                $objColumn->getName (),
60
-                $makerFile->getConfig ()
61
-                          ->createClassNamespace ( $constrant ) . Phalcon::SEPARETOR . AbstractMaker::getClassName (
62
-                    $constrant->getTable ()
59
+                $objColumn->getName(),
60
+                $makerFile->getConfig()
61
+                          ->createClassNamespace($constrant) . Phalcon::SEPARETOR . AbstractMaker::getClassName(
62
+                    $constrant->getTable()
63 63
                 ),
64
-                $constrant->getColumn (),
65
-                AbstractMaker::getClassName ( $constrant->getTable () )
64
+                $constrant->getColumn(),
65
+                AbstractMaker::getClassName($constrant->getTable())
66 66
             );
67 67
         }
68 68
 
69
-        if ( sizeof ( $references ) > 0 ) {
70
-            $mapParents = join ( ";\n\t\t", $references ) . ";\n";
69
+        if (sizeof($references) > 0) {
70
+            $mapParents = join(";\n\t\t", $references) . ";\n";
71 71
         }
72 72
 
73 73
 
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return array
82 82
      */
83
-    private function listDependence ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
83
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
84 84
     {
85 85
         $mapDependence = '';
86
-        $references    = array ();
87
-        foreach ( $dbTable->getDependences () as $objColumn ) {
88
-            foreach ( $objColumn->getDependences () as $dependence ) {
89
-                $references[] = sprintf (
86
+        $references    = array();
87
+        foreach ($dbTable->getDependences() as $objColumn) {
88
+            foreach ($objColumn->getDependences() as $dependence) {
89
+                $references[] = sprintf(
90 90
                     '$this->hasMany(\'%s\', \'%s\', \'%s\', array(\'alias\' => \'%s\'))',
91
-                    $objColumn->getName (),
92
-                    $makerFile->getConfig ()
93
-                              ->createClassNamespace ( $dependence )
91
+                    $objColumn->getName(),
92
+                    $makerFile->getConfig()
93
+                              ->createClassNamespace($dependence)
94 94
                     . Phalcon::SEPARETOR
95
-                    . AbstractMaker::getClassName ( $dependence->getTable () ),
96
-                    $dependence->getColumn (),
97
-                    AbstractMaker::getClassName ( $dependence->getTable () )
95
+                    . AbstractMaker::getClassName($dependence->getTable()),
96
+                    $dependence->getColumn(),
97
+                    AbstractMaker::getClassName($dependence->getTable())
98 98
                 );
99 99
 
100 100
             }
101 101
         }
102 102
 
103
-        if ( sizeof ( $references ) > 0 ) {
104
-            $mapDependence = join ( ";\n\t\t", $references ) . ";";
103
+        if (sizeof($references) > 0) {
104
+            $mapDependence = join(";\n\t\t", $references) . ";";
105 105
         }
106 106
 
107 107
         return $mapDependence;
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/Phalcon/Peer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,15 +13,15 @@
 block discarded – undo
13 13
 
14 14
     public    $pastName      = 'Peer';
15 15
     protected $fileTpl       = "peer.php";
16
-    protected $fileFixedData = array (
17
-        'parentclass' => array (
18
-            'name' => "AbstractPeer" ,
16
+    protected $fileFixedData = array(
17
+        'parentclass' => array(
18
+            'name' => "AbstractPeer",
19 19
             'tpl'  => "peer_abstract.php"
20 20
         )
21 21
     );
22 22
 
23
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
23
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
24 24
     {
25
-        return array ();
25
+        return array();
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/Entity.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -18,19 +18,19 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public    $pastName      = 'Entity';
20 20
     protected $fileTpl       = "entity.php";
21
-    protected $fileFixedData = array (
22
-        'parentclass' => array (
23
-            'name' => "EntityAbstract" ,
21
+    protected $fileFixedData = array(
22
+        'parentclass' => array(
23
+            'name' => "EntityAbstract",
24 24
             'tpl'  => "entity_abstract.php"
25
-        ) ,
26
-        'exception'   => array (
27
-            'name' => "EntityException" ,
25
+        ),
26
+        'exception'   => array(
27
+            'name' => "EntityException",
28 28
             'tpl'  => "entity_exception.php"
29 29
         )
30 30
     );
31
-    protected $overwrite     = true;
31
+    protected $overwrite = true;
32 32
 
33
-    protected $validFunc = array ();
33
+    protected $validFunc = array();
34 34
 
35 35
     /**
36 36
      * @param \Classes\MakerFile  $makerFile
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return array
40 40
      */
41
-    public function parseRelation ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
41
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
42 42
     {
43
-        return array (
44
-            'parents' => $this->listParents ( $makerFile , $dbTable ) ,
45
-            'depends' => $this->listDependence ( $makerFile , $dbTable )
43
+        return array(
44
+            'parents' => $this->listParents($makerFile, $dbTable),
45
+            'depends' => $this->listDependence($makerFile, $dbTable)
46 46
         );
47 47
     }
48 48
 
@@ -52,39 +52,39 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return array
54 54
      */
55
-    private function listParents ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
55
+    private function listParents(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
56 56
     {
57
-        $parents = array ();
58
-        foreach ( $dbTable->getForeingkeys () as $objColumn )
57
+        $parents = array();
58
+        foreach ($dbTable->getForeingkeys() as $objColumn)
59 59
         {
60
-            $constrant = $objColumn->getFks ();
60
+            $constrant = $objColumn->getFks();
61 61
             $name =
62 62
                 'Parent'
63 63
                 . ZendFrameworkOne::SEPARETOR
64
-                . AbstractMaker::getClassName ( $constrant->getTable () )
64
+                . AbstractMaker::getClassName($constrant->getTable())
65 65
                 . ZendFrameworkOne::SEPARETOR
66 66
                 . 'By'
67 67
                 . ZendFrameworkOne::SEPARETOR
68
-                . $objColumn->getName ();
68
+                . $objColumn->getName();
69 69
 
70
-            $variable = $constrant->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
70
+            $variable = $constrant->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
71 71
 
72
-            $arrClass = array (
73
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
74
-                AbstractMaker::getClassName ( $constrant->getTable () )
72
+            $arrClass = array(
73
+                $makerFile->getConfig()->createClassNamespace($constrant),
74
+                AbstractMaker::getClassName($constrant->getTable())
75 75
             );
76
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
77
-
78
-            $parents[] = array (
79
-                'class'    => $class ,
80
-                'function' => AbstractMaker::getClassName ( $name ) ,
81
-                'table'    => $constrant->getTable () ,
82
-                'column'   => $constrant->getColumn() ,
83
-                'name'     => $constrant->getNameConstrant() ,
76
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
77
+
78
+            $parents[] = array(
79
+                'class'    => $class,
80
+                'function' => AbstractMaker::getClassName($name),
81
+                'table'    => $constrant->getTable(),
82
+                'column'   => $constrant->getColumn(),
83
+                'name'     => $constrant->getNameConstrant(),
84 84
                 'variable' => $variable
85 85
 
86 86
             );
87
-            unset( $name );
87
+            unset($name);
88 88
         }
89 89
 
90 90
         return $parents;
@@ -96,43 +96,43 @@  discard block
 block discarded – undo
96 96
      *
97 97
      * @return array
98 98
      */
99
-    private function listDependence ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
99
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
100 100
     {
101
-        $depends = array ();
102
-        foreach ( $dbTable->getDependences () as $objColumn )
101
+        $depends = array();
102
+        foreach ($dbTable->getDependences() as $objColumn)
103 103
         {
104
-            foreach ( $objColumn->getDependences () as $dependence )
104
+            foreach ($objColumn->getDependences() as $dependence)
105 105
             {
106 106
                 $name =
107 107
                     'Depend'
108 108
                     . ZendFrameworkOne::SEPARETOR
109
-                    . AbstractMaker::getClassName ( $dependence->getTable () )
109
+                    . AbstractMaker::getClassName($dependence->getTable())
110 110
                     . ZendFrameworkOne::SEPARETOR
111 111
                     . 'By'
112 112
                     . ZendFrameworkOne::SEPARETOR
113
-                    . $objColumn->getName ();
113
+                    . $objColumn->getName();
114 114
 
115
-                if ( ! key_exists ( $name , $this->validFunc ) )
115
+                if ( ! key_exists($name, $this->validFunc))
116 116
                 {
117
-                    $variable = $dependence->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
117
+                    $variable = $dependence->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
118 118
 
119
-                    $arrClass = array (
120
-                        $makerFile->getConfig ()->createClassNamespace ( $dependence ),
121
-                        AbstractMaker::getClassName ( $dependence->getTable () )
119
+                    $arrClass = array(
120
+                        $makerFile->getConfig()->createClassNamespace($dependence),
121
+                        AbstractMaker::getClassName($dependence->getTable())
122 122
                     );
123
-                    $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
123
+                    $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
124 124
 
125
-                    $this->validFunc[ $name ] = true;
126
-                    $depends[] = array (
125
+                    $this->validFunc[$name] = true;
126
+                    $depends[] = array(
127 127
                         'class'    =>  $class,
128
-                        'function' => AbstractMaker::getClassName ( $name ) ,
129
-                        'table'    => $dependence->getTable () ,
130
-                        'column'   => $dependence->getColumn () ,
131
-                        'name'     =>  $dependence->getNameConstrant (),
128
+                        'function' => AbstractMaker::getClassName($name),
129
+                        'table'    => $dependence->getTable(),
130
+                        'column'   => $dependence->getColumn(),
131
+                        'name'     =>  $dependence->getNameConstrant(),
132 132
                         'variable' => $variable
133 133
                     );
134 134
                 }
135
-                unset( $name );
135
+                unset($name);
136 136
             }
137 137
         }
138 138
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/DbTable.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
 
16 16
     public    $pastName      = 'DbTable';
17 17
     protected $fileTpl       = "dbtable.php";
18
-    protected $fileFixedData = array (
19
-        'parentclass' => array (
20
-            'name' => "TableAbstract" ,
18
+    protected $fileFixedData = array(
19
+        'parentclass' => array(
20
+            'name' => "TableAbstract",
21 21
             'tpl'  => "dbtable_abstract.php"
22 22
         )
23 23
     );
24 24
 
25
-    protected $overwrite     = true;
25
+    protected $overwrite = true;
26 26
 
27 27
     /**
28 28
      * @param \Classes\MakerFile $makerFile
@@ -30,68 +30,68 @@  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 35
         $referenceMap = '';
36
-        $references = array ();
36
+        $references = array();
37 37
         $dependentTables = '';
38
-        $dependents = array ();
39
-        foreach ( $dbTable->getForeingkeys () as $objColumn )
38
+        $dependents = array();
39
+        foreach ($dbTable->getForeingkeys() as $objColumn)
40 40
         {
41
-            $constrant = $objColumn->getFks ();
42
-            $variable =  $constrant->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
41
+            $constrant = $objColumn->getFks();
42
+            $variable = $constrant->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
43 43
 
44
-            $arrClass = array (
45
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
44
+            $arrClass = array(
45
+                $makerFile->getConfig()->createClassNamespace($constrant),
46 46
                 'DbTable',
47
-                AbstractMaker::getClassName ( $constrant->getTable () )
47
+                AbstractMaker::getClassName($constrant->getTable())
48 48
             );
49
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
49
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
50 50
 
51
-            $references[] = sprintf (
51
+            $references[] = sprintf(
52 52
                 "
53 53
        '%s' => array (
54 54
             'columns'       => '%s' ,
55 55
             'refTableClass' => '%s',
56 56
             'refColumns'    =>'%s'
57 57
        )",
58
-                AbstractMaker::getClassName ( $variable ),
59
-                $objColumn->getName (),
58
+                AbstractMaker::getClassName($variable),
59
+                $objColumn->getName(),
60 60
                 $class,
61
-                $constrant->getColumn ()
61
+                $constrant->getColumn()
62 62
 
63 63
             );
64 64
         }
65 65
 
66
-        if ( sizeof ( $references ) > 0 )
66
+        if (sizeof($references) > 0)
67 67
         {
68 68
             $referenceMap = "protected \$_referenceMap = array(" .
69
-                join ( ',', $references ) . "\n    );";
69
+                join(',', $references) . "\n    );";
70 70
         }
71 71
 
72
-        foreach ( $dbTable->getDependences () as $objColumn )
72
+        foreach ($dbTable->getDependences() as $objColumn)
73 73
         {
74
-            foreach ( $objColumn->getDependences () as $dependence )
74
+            foreach ($objColumn->getDependences() as $dependence)
75 75
             {
76
-                $arrClass = array (
77
-                    $makerFile->getConfig ()->createClassNamespace ( $dependence ),
76
+                $arrClass = array(
77
+                    $makerFile->getConfig()->createClassNamespace($dependence),
78 78
                     'DbTable',
79
-                    AbstractMaker::getClassName ( $dependence->getTable () )
79
+                    AbstractMaker::getClassName($dependence->getTable())
80 80
                 );
81
-                $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
81
+                $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
82 82
 
83 83
                 $dependents[] = $class;
84 84
             }
85 85
         }
86 86
 
87
-        if ( sizeof ( $dependents ) > 0 )
87
+        if (sizeof($dependents) > 0)
88 88
         {
89 89
             $dependentTables = "protected \$_dependentTables = array(\n        '" .
90
-                join ( "',\n        '", $dependents ) . "'\n    );";
90
+                join("',\n        '", $dependents) . "'\n    );";
91 91
         }
92 92
 
93 93
 
94
-        return array (
94
+        return array(
95 95
             'referenceMap'    => $referenceMap,
96 96
             'dependentTables' => $dependentTables
97 97
         );
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/Model.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
      * @var void
14 14
      */
15 15
     protected $fileTpl       = "model.php";
16
-    protected $fileFixedData = array (
17
-        'exception' => array (
18
-            'tpl'  => "model_exception.php" ,
16
+    protected $fileFixedData = array(
17
+        'exception' => array(
18
+            'tpl'  => "model_exception.php",
19 19
             'name' => "Exception"
20 20
         )
21 21
     );
22 22
 
23
-    public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable )
23
+    public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
24 24
     {
25 25
        return array();
26 26
     }
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/FilesFixeds.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,25 +20,25 @@  discard block
 block discarded – undo
20 20
      */
21 21
     private $fileName;
22 22
 
23
-    private function __construct (){ }
23
+    private function __construct() { }
24 24
 
25
-    public static function getInstance ( $args = array () )
25
+    public static function getInstance($args = array())
26 26
     {
27 27
         $obj = new FilesFixeds();
28
-        if ( key_exists ( 'tpl' , $args ) )
28
+        if (key_exists('tpl', $args))
29 29
         {
30
-            $obj->setTpl ( $args[ 'tpl' ] );
30
+            $obj->setTpl($args['tpl']);
31 31
         }
32 32
 
33
-        if ( key_exists ( 'name' , $args ) )
33
+        if (key_exists('name', $args))
34 34
         {
35
-            $obj->setFileName ( $args[ 'name' ] );
35
+            $obj->setFileName($args['name']);
36 36
         }
37 37
 
38 38
         return $obj;
39 39
     }
40 40
 
41
-    public function hasData ()
41
+    public function hasData()
42 42
     {
43 43
         return $this->hasTpl() && $this->hasFileName();
44 44
     }
@@ -46,23 +46,23 @@  discard block
 block discarded – undo
46 46
     /**
47 47
      * @return bool
48 48
      */
49
-    public function hasTpl ()
49
+    public function hasTpl()
50 50
     {
51
-        return !empty($this->tpl);
51
+        return ! empty($this->tpl);
52 52
     }
53 53
 
54 54
     /**
55 55
      * @return bool
56 56
      */
57
-    public function hasFileName ()
57
+    public function hasFileName()
58 58
     {
59
-        return !empty($this->fileName);
59
+        return ! empty($this->fileName);
60 60
     }
61 61
 
62 62
     /**
63 63
      * @return string
64 64
      */
65
-    public function getTpl ()
65
+    public function getTpl()
66 66
     {
67 67
         return $this->tpl;
68 68
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * @param string $tpl
72 72
      */
73
-    public function setTpl ( $tpl )
73
+    public function setTpl($tpl)
74 74
     {
75 75
         $this->tpl = $tpl;
76 76
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     /**
79 79
      * @return string
80 80
      */
81
-    public function getFileName ()
81
+    public function getFileName()
82 82
     {
83 83
         return $this->fileName;
84 84
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     /**
87 87
      * @param string $fileName
88 88
      */
89
-    public function setFileName ( $fileName )
89
+    public function setFileName($fileName)
90 90
     {
91 91
         $this->fileName = $fileName;
92 92
     }
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/AbstractAdapter.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  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
      * @type FilesFixeds[]
18 18
      */
19
-    private $instanceFixedFile = array ();
19
+    private $instanceFixedFile = array();
20 20
 
21 21
     /**
22 22
      * @param \Classes\MakerFile  $makerFile
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      *
25 25
      * @return array
26 26
      */
27
-    abstract public function parseRelation ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable );
27
+    abstract public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable);
28 28
 
29 29
     /**
30 30
      * @type string nome do arquivo template
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      *
42 42
      * @type string[][]
43 43
      */
44
-    protected $fileFixedData = array ();
44
+    protected $fileFixedData = array();
45 45
 
46 46
     /**
47 47
      * @var bool
@@ -51,22 +51,22 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      *
53 53
      */
54
-    final private function __construct ()
54
+    final private function __construct()
55 55
     {
56 56
     }
57 57
 
58 58
     /**
59 59
      * @return \Classes\AdapterMakerFile\AbstractAdapter
60 60
      */
61
-    public static function getInstance ()
61
+    public static function getInstance()
62 62
     {
63
-        $class = get_called_class ();
64
-        if ( ! isset( self::$_instance[ $class ] ) )
63
+        $class = get_called_class();
64
+        if ( ! isset(self::$_instance[$class]))
65 65
         {
66
-            self::$_instance[ $class ] = new $class();
66
+            self::$_instance[$class] = new $class();
67 67
         }
68 68
 
69
-        return self::$_instance[ $class ];
69
+        return self::$_instance[$class];
70 70
     }
71 71
 
72 72
     /**
@@ -74,28 +74,28 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return bool
76 76
      */
77
-    public function hasDiretory ()
77
+    public function hasDiretory()
78 78
     {
79
-        return ! empty( $this->pastName );
79
+        return ! empty($this->pastName);
80 80
     }
81 81
 
82 82
     /**
83 83
      * @return \Classes\AdapterMakerFile\FilesFixeds
84 84
      */
85
-    public function getFilesFixeds ( $key )
85
+    public function getFilesFixeds($key)
86 86
     {
87 87
         $key = strtolower($key);
88
-        if ( ! isset( $this->fileFixedData[ $key ] ) )
88
+        if ( ! isset($this->fileFixedData[$key]))
89 89
         {
90
-            throw new \Exception( 'Não existe dados para popular o FilesFixeds ' . $key );
90
+            throw new \Exception('Não existe dados para popular o FilesFixeds ' . $key);
91 91
         }
92 92
 
93
-        if ( !isset($this->instanceFixedFile[ $key ]) or ! $this->instanceFixedFile[ $key ] instanceof FilesFixeds )
93
+        if ( ! isset($this->instanceFixedFile[$key]) or ! $this->instanceFixedFile[$key] instanceof FilesFixeds)
94 94
         {
95
-            $this->instanceFixedFile[ $key ] = FilesFixeds::getInstance ( $this->fileFixedData[ $key ] );
95
+            $this->instanceFixedFile[$key] = FilesFixeds::getInstance($this->fileFixedData[$key]);
96 96
         }
97 97
 
98
-        return $this->instanceFixedFile[ $key ];
98
+        return $this->instanceFixedFile[$key];
99 99
     }
100 100
 
101 101
     /**
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
      *
104 104
      * @return bool
105 105
      */
106
-    public function hasFilesFixeds ( $key )
106
+    public function hasFilesFixeds($key)
107 107
     {
108
-        return $this->getFilesFixeds ( strtolower($key) )->hasData ();
108
+        return $this->getFilesFixeds(strtolower($key))->hasData();
109 109
     }
110 110
 
111 111
     /**
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
      *
114 114
      * @return array
115 115
      */
116
-    public function getListFilesFixed ()
116
+    public function getListFilesFixed()
117 117
     {
118
-        return \array_keys ( $this->fileFixedData );
118
+        return \array_keys($this->fileFixedData);
119 119
     }
120 120
 
121 121
     /**
122 122
      * @return string
123 123
      */
124
-    public function getFileTpl ()
124
+    public function getFileTpl()
125 125
     {
126 126
         return $this->fileTpl;
127 127
     }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     /**
130 130
      * @return string
131 131
      */
132
-    public function getPastName ()
132
+    public function getPastName()
133 133
     {
134 134
         return $this->pastName;
135 135
     }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     /**
138 138
      * @return bool
139 139
      */
140
-    public function isOverwrite ()
140
+    public function isOverwrite()
141 141
     {
142 142
         return $this->overwrite;
143 143
     }
Please login to merge, or discard this patch.
build/Classes/templates/phalcon/entity.php 1 patch
Spacing   +27 added lines, -27 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 \<?=$this->config->namespace?$this->config->namespace."\\":""?>Models\<?=$objMakeFile->getFilesFixeds('parentClass')->getFileName() . "\n"?>
22
+abstract class <?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?> extends \<?=$this->config->namespace ? $this->config->namespace . "\\" : ""?>Models\<?=$objMakeFile->getFilesFixeds('parentClass')->getFileName() . "\n"?>
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->getTypeByConfig( $this->config )?>", nullable=<?=$column->isNullable () ? "true" : "false"?><?php
36
-if ( $column->getMaxLength () ): ?>
37
-, length=<?=$column->getMaxLength ()?>
35
+    * @Column(type="<?=$column->getTypeByConfig($this->config)?>", nullable=<?=$column->isNullable() ? "true" : "false"?><?php
36
+if ($column->getMaxLength()): ?>
37
+, length=<?=$column->getMaxLength()?>
38 38
 <?php endif ?>, column="<?=$column->getName()?>" )
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,28 +92,28 @@  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
     }
103 103
 
104 104
 <?php endif ?>
105 105
 <?php foreach ($objTables->getColumns() as $column): ?>
106
-    public function set<?=$this->getClassName ( $column->getName () )?>( $<?=$column->getName()?> )
106
+    public function set<?=$this->getClassName($column->getName())?>( $<?=$column->getName()?> )
107 107
     {
108 108
         $this-><?=$column->getName()?> = $<?=$column->getName()?>;
109 109
     }
110 110
 
111 111
     /**
112
-    * @return <?=$column->getType ()."\n" ?>
112
+    * @return <?=$column->getType() . "\n" ?>
113 113
     **/
114
-    public function get<?=$this->getClassName ( $column->getName () )?>()
114
+    public function get<?=$this->getClassName($column->getName())?>()
115 115
     {
116
-        return (<?=$column->getType () ?>) $this-><?=$column->getName()?>;
116
+        return (<?=$column->getType() ?>) $this-><?=$column->getName()?>;
117 117
     }
118
-<?php endforeach;?>
118
+<?php endforeach; ?>
119 119
 }
120 120
\ No newline at end of file
Please login to merge, or discard this patch.