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 (#13)
by Pedro
04:44
created
build/Classes/AdapterConfig/Phalcon.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
      * @var string
23 23
      */
24 24
     protected $framework    = "phalcon";
25
-    public    $reservedWord = array ( 'public' => 'Main' );
25
+    public    $reservedWord = array('public' => 'Main');
26 26
 
27
-    protected $dataTypes = array (
27
+    protected $dataTypes = array(
28 28
         'int'    => 'integer',
29 29
         'float'  => 'decimal'
30 30
     );
31 31
 
32 32
     const SEPARETOR = "\\";
33 33
 
34
-    protected function init ()
34
+    protected function init()
35 35
     {
36 36
     }
37 37
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return array
42 42
      */
43
-    protected function getParams ()
43
+    protected function getParams()
44 44
     {
45 45
 
46 46
     }
47 47
 
48
-    protected function parseFrameworkConfig ()
48
+    protected function parseFrameworkConfig()
49 49
     {
50 50
         // TODO: Implement parseFrameworkConfig() method.
51 51
     }
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * @inheritdoc
55 55
      */
56
-    protected function getBaseNamespace ()
56
+    protected function getBaseNamespace()
57 57
     {
58
-        return array (
59
-            $this->arrConfig[ 'namespace' ],
58
+        return array(
59
+            $this->arrConfig['namespace'],
60 60
             'Models'
61 61
         );
62 62
     }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @return \Classes\AdapterMakerFile\AbstractAdapter[]
68 68
      */
69
-    public function getMakeFileInstances ()
69
+    public function getMakeFileInstances()
70 70
     {
71
-        return array (
72
-            Entity::getInstance (),
73
-            Model::getInstance (),
74
-            Peer::getInstance ()
71
+        return array(
72
+            Entity::getInstance(),
73
+            Model::getInstance(),
74
+            Peer::getInstance()
75 75
         );
76 76
     }
77 77
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/Entity.php 1 patch
Spacing   +43 added lines, -43 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,39 +44,39 @@  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
-            $variable = $constrant->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
62
+            $variable = $constrant->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
63 63
 
64
-            $arrClass = array (
65
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
66
-                AbstractMaker::getClassName ( $constrant->getTable () )
64
+            $arrClass = array(
65
+                $makerFile->getConfig()->createClassNamespace($constrant),
66
+                AbstractMaker::getClassName($constrant->getTable())
67 67
             );
68
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
69
-
70
-            $parents[] = array (
71
-                'class'    => $class ,
72
-                'function' => AbstractMaker::getClassName ( $name ) ,
73
-                'table'    => $constrant->getTable () ,
74
-                'column'   => $constrant->getColumn() ,
75
-                'name'     => $constrant->getNameConstrant() ,
68
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
69
+
70
+            $parents[] = array(
71
+                'class'    => $class,
72
+                'function' => AbstractMaker::getClassName($name),
73
+                'table'    => $constrant->getTable(),
74
+                'column'   => $constrant->getColumn(),
75
+                'name'     => $constrant->getNameConstrant(),
76 76
                 'variable' => $variable
77 77
 
78 78
             );
79
-            unset( $name );
79
+            unset($name);
80 80
         }
81 81
 
82 82
         return $parents;
@@ -88,43 +88,43 @@  discard block
 block discarded – undo
88 88
      *
89 89
      * @return array
90 90
      */
91
-    private function listDependence ( \Classes\MakerFile $makerFile , \Classes\Db\DbTable $dbTable )
91
+    private function listDependence(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable)
92 92
     {
93
-        $depends = array ();
94
-        foreach ( $dbTable->getDependences () as $objColumn )
93
+        $depends = array();
94
+        foreach ($dbTable->getDependences() as $objColumn)
95 95
         {
96
-            foreach ( $objColumn->getDependences () as $dependence )
96
+            foreach ($objColumn->getDependences() as $dependence)
97 97
             {
98 98
                 $name =
99 99
                     'Depend'
100 100
                     . ZendFrameworkOne::SEPARETOR
101
-                    . AbstractMaker::getClassName ( $dependence->getTable () )
101
+                    . AbstractMaker::getClassName($dependence->getTable())
102 102
                     . ZendFrameworkOne::SEPARETOR
103 103
                     . 'By'
104 104
                     . ZendFrameworkOne::SEPARETOR
105
-                    . $objColumn->getName ();
105
+                    . $objColumn->getName();
106 106
 
107
-                if ( ! key_exists ( $name , $this->validFunc ) )
107
+                if ( ! key_exists($name, $this->validFunc))
108 108
                 {
109
-                    $variable = $dependence->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
109
+                    $variable = $dependence->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
110 110
 
111
-                    $arrClass = array (
112
-                        $makerFile->getConfig ()->createClassNamespace ( $dependence ),
113
-                        AbstractMaker::getClassName ( $dependence->getTable () )
111
+                    $arrClass = array(
112
+                        $makerFile->getConfig()->createClassNamespace($dependence),
113
+                        AbstractMaker::getClassName($dependence->getTable())
114 114
                     );
115
-                    $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
115
+                    $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
116 116
 
117
-                    $this->validFunc[ $name ] = true;
118
-                    $depends[] = array (
117
+                    $this->validFunc[$name] = true;
118
+                    $depends[] = array(
119 119
                         'class'    =>  $class,
120
-                        'function' => AbstractMaker::getClassName ( $name ) ,
121
-                        'table'    => $dependence->getTable () ,
122
-                        'column'   => $dependence->getColumn () ,
123
-                        'name'     =>  $dependence->getNameConstrant (),
120
+                        'function' => AbstractMaker::getClassName($name),
121
+                        'table'    => $dependence->getTable(),
122
+                        'column'   => $dependence->getColumn(),
123
+                        'name'     =>  $dependence->getNameConstrant(),
124 124
                         'variable' => $variable
125 125
                     );
126 126
                 }
127
-                unset( $name );
127
+                unset($name);
128 128
             }
129 129
         }
130 130
 
Please login to merge, or discard this patch.
build/Classes/AdapterMakerFile/ZendFrameworkOne/DbTable.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -28,68 +28,68 @@
 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 ();
40
-            $variable =  $constrant->getNameConstrant () . ZendFrameworkOne::SEPARETOR . $objColumn->getName ();
39
+            $constrant = $objColumn->getFks();
40
+            $variable = $constrant->getNameConstrant() . ZendFrameworkOne::SEPARETOR . $objColumn->getName();
41 41
 
42
-            $arrClass = array (
43
-                $makerFile->getConfig ()->createClassNamespace ( $constrant ),
42
+            $arrClass = array(
43
+                $makerFile->getConfig()->createClassNamespace($constrant),
44 44
                 'DbTable',
45
-                AbstractMaker::getClassName ( $constrant->getTable () )
45
+                AbstractMaker::getClassName($constrant->getTable())
46 46
             );
47
-            $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
47
+            $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
48 48
 
49
-            $references[] = sprintf (
49
+            $references[] = sprintf(
50 50
                 "
51 51
        '%s' => array (
52 52
             'columns'       => '%s' ,
53 53
             'refTableClass' => '%s',
54 54
             'refColumns'    =>'%s'
55 55
        )",
56
-                AbstractMaker::getClassName ( $variable ),
57
-                $objColumn->getName (),
56
+                AbstractMaker::getClassName($variable),
57
+                $objColumn->getName(),
58 58
                 $class,
59
-                $constrant->getColumn ()
59
+                $constrant->getColumn()
60 60
 
61 61
             );
62 62
         }
63 63
 
64
-        if ( sizeof ( $references ) > 0 )
64
+        if (sizeof($references) > 0)
65 65
         {
66 66
             $referenceMap = "protected \$_referenceMap = array(" .
67
-                join ( ',', $references ) . "\n    );";
67
+                join(',', $references) . "\n    );";
68 68
         }
69 69
 
70
-        foreach ( $dbTable->getDependences () as $objColumn )
70
+        foreach ($dbTable->getDependences() as $objColumn)
71 71
         {
72
-            foreach ( $objColumn->getDependences () as $dependence )
72
+            foreach ($objColumn->getDependences() as $dependence)
73 73
             {
74
-                $arrClass = array (
75
-                    $makerFile->getConfig ()->createClassNamespace ( $dependence ),
74
+                $arrClass = array(
75
+                    $makerFile->getConfig()->createClassNamespace($dependence),
76 76
                     'DbTable',
77
-                    AbstractMaker::getClassName ( $dependence->getTable () )
77
+                    AbstractMaker::getClassName($dependence->getTable())
78 78
                 );
79
-                $class = implode ( ZendFrameworkOne::SEPARETOR , array_filter ( $arrClass ) );
79
+                $class = implode(ZendFrameworkOne::SEPARETOR, array_filter($arrClass));
80 80
 
81 81
                 $dependents[] = $class;
82 82
             }
83 83
         }
84 84
 
85
-        if ( sizeof ( $dependents ) > 0 )
85
+        if (sizeof($dependents) > 0)
86 86
         {
87 87
             $dependentTables = "protected \$_dependentTables = array(\n        '" .
88
-                join ( "',\n        '", $dependents ) . "'\n    );";
88
+                join("',\n        '", $dependents) . "'\n    );";
89 89
         }
90 90
 
91 91
 
92
-        return array (
92
+        return array(
93 93
             'referenceMap'    => $referenceMap,
94 94
             'dependentTables' => $dependentTables
95 95
         );
Please login to merge, or discard this patch.
build/Classes/templates/zf1/model.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,20 +3,20 @@
 block discarded – undo
3 3
 /**
4 4
  * Data Entity implementation for this class
5 5
  *
6
- * <?=$this->config->last_modify."\n"?>
6
+ * <?=$this->config->last_modify . "\n"?>
7 7
  *
8
- * @package <?=$objTables->getNamespace()."\n"?>
9
- * @see  <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?>. <?="\n"?>
8
+ * @package <?=$objTables->getNamespace() . "\n"?>
9
+ * @see  <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?>. <?="\n"?>
10 10
  *
11
- * @author    <?=$this->config->author."\n"?>
11
+ * @author    <?=$this->config->author . "\n"?>
12 12
  *
13
- * @copyright <?=$this->config->copyright."\n"?>
14
- * @license   <?=$this->config->license."\n"?>
15
- * @link      <?=$this->config->link."\n"?>
16
- * @version   <?=$this->config->version."\n"?>
13
+ * @copyright <?=$this->config->copyright . "\n"?>
14
+ * @license   <?=$this->config->license . "\n"?>
15
+ * @link      <?=$this->config->link . "\n"?>
16
+ * @version   <?=$this->config->version . "\n"?>
17 17
  */
18 18
 
19
-class <?=$objTables->getNamespace()?>_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () )?> extends <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName ( $objTables->getName () ). "\n"?>
19
+class <?=$objTables->getNamespace()?>_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName())?> extends <?=$objTables->getNamespace()?>_Entity_<?=\Classes\Maker\AbstractMaker::getClassName($objTables->getName()) . "\n"?>
20 20
 {
21 21
        /* @TODO Codifique aqui */
22 22
 }
Please login to merge, or discard this patch.
build/Classes/Config.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
 
158 158
         $configIni = isset( $argv[ 'config-ini' ] )
159 159
             ? $argv[ 'config-ini' ] : $this->_basePath
160
-                                      . $this->configIniDefault;
160
+                                        . $this->configIniDefault;
161 161
 
162 162
         $configTemp    = $this->loadIniFile ( realpath ( $configIni ) );
163 163
         $configCurrent = self::parseConfigEnv ( $configTemp, $argv );
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 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,13 +64,13 @@  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
-    private $parameterList = array (
73
+    private $parameterList = array(
74 74
         'init'       => 'Creates the necessary configuration file to start using the orm-generator.',
75 75
         'config-ini' => 'reference to another .ini file configuration (relative path).',
76 76
         'config-env' => 'orm-generator configuration environment.',
@@ -85,19 +85,19 @@  discard block
 block discarded – undo
85 85
         'path'       => "specify where to create the files (default is current directory).",
86 86
     );
87 87
 
88
-    public function __construct ( $argv, $basePath, $numArgs )
88
+    public function __construct($argv, $basePath, $numArgs)
89 89
     {
90
-        if ( array_key_exists ( 'help', $argv ) or ( $numArgs > 1 && count ( $argv ) < 1 ) ) {
91
-            die ( $this->getUsage () );
90
+        if (array_key_exists('help', $argv) or ($numArgs > 1 && count($argv) < 1)) {
91
+            die ($this->getUsage());
92 92
         }
93
-        if ( array_key_exists ( 'version', $argv ) ) {
94
-            die ( $this->getVersion () );
93
+        if (array_key_exists('version', $argv)) {
94
+            die ($this->getVersion());
95 95
         }
96
-        if ( array_key_exists ( 'status', $argv ) ) {
97
-            $argv[ 'status' ] = true;
96
+        if (array_key_exists('status', $argv)) {
97
+            $argv['status'] = true;
98 98
         }
99 99
 
100
-        $this->argv = $this->parseConfig ( $basePath, $argv );
100
+        $this->argv = $this->parseConfig($basePath, $argv);
101 101
     }
102 102
 
103 103
     /**
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @return string
107 107
      */
108
-    public function getUsage ()
108
+    public function getUsage()
109 109
     {
110
-        $version = $this->getVersion ();
111
-        $list    = $this->renderParam ();
110
+        $version = $this->getVersion();
111
+        $list    = $this->renderParam();
112 112
 
113 113
         return <<<EOF
114 114
 parameters:
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 EOF;
120 120
     }
121 121
 
122
-    public function renderParam ()
122
+    public function renderParam()
123 123
     {
124 124
         $return = "";
125
-        foreach ( $this->parameterList as $param => $desc ) {
126
-            if ( strlen ( $param ) < 5 ) {
125
+        foreach ($this->parameterList as $param => $desc) {
126
+            if (strlen($param) < 5) {
127 127
                 $return .= "\t--" . $param . "\t\t: " . $desc . "\n";
128 128
             }
129 129
             else {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         return $return;
136 136
     }
137 137
 
138
-    public function getVersion ()
138
+    public function getVersion()
139 139
     {
140 140
         $version = static::$version;
141 141
 
@@ -151,27 +151,27 @@  discard block
 block discarded – undo
151 151
      * @return array
152 152
      * @throws \Exception
153 153
      */
154
-    private function parseConfig ( $basePath, $argv )
154
+    private function parseConfig($basePath, $argv)
155 155
     {
156
-        $this->_basePath = dirname ( $basePath . '/' );
156
+        $this->_basePath = dirname($basePath . '/');
157 157
 
158
-        $configIni = isset( $argv[ 'config-ini' ] )
159
-            ? $argv[ 'config-ini' ] : $this->_basePath
158
+        $configIni = isset($argv['config-ini'])
159
+            ? $argv['config-ini'] : $this->_basePath
160 160
                                       . $this->configIniDefault;
161 161
 
162
-        $configTemp    = $this->loadIniFile ( realpath ( $configIni ) );
163
-        $configCurrent = self::parseConfigEnv ( $configTemp, $argv );
162
+        $configTemp    = $this->loadIniFile(realpath($configIni));
163
+        $configCurrent = self::parseConfigEnv($configTemp, $argv);
164 164
 
165
-        if ( !isset( $configCurrent[ 'framework' ] ) ) {
166
-            throw new \Exception( "configure which framework you want to use! \n" );
165
+        if ( ! isset($configCurrent['framework'])) {
166
+            throw new \Exception("configure which framework you want to use! \n");
167 167
         }
168 168
 
169
-        if ( !in_array ( $configCurrent[ 'framework' ], $this->frameworkList ) ) {
170
-            $frameworks = implode ( "\n\t", $this->frameworkList );
171
-            throw new \Exception( "list of frameworks: \n\t\033[1;33m" . $frameworks . "\n\033[0m" );
169
+        if ( ! in_array($configCurrent['framework'], $this->frameworkList)) {
170
+            $frameworks = implode("\n\t", $this->frameworkList);
171
+            throw new \Exception("list of frameworks: \n\t\033[1;33m" . $frameworks . "\n\033[0m");
172 172
         }
173 173
 
174
-        return $argv + array_filter ( $configCurrent );
174
+        return $argv + array_filter($configCurrent);
175 175
     }
176 176
 
177 177
     /**
@@ -181,20 +181,20 @@  discard block
 block discarded – undo
181 181
      *
182 182
      * @return string
183 183
      */
184
-    private static function parseConfigEnv ( $configTemp, $argv )
184
+    private static function parseConfigEnv($configTemp, $argv)
185 185
     {
186
-        $thisSection = isset( $configTemp[ key ( $configTemp ) ][ 'config-env' ] ) ? $configTemp[ key (
186
+        $thisSection = isset($configTemp[key($configTemp)]['config-env']) ? $configTemp[key(
187 187
             $configTemp
188
-        ) ][ 'config-env' ] : null;
188
+        )]['config-env'] : null;
189 189
 
190
-        $thisSection = isset( $argv[ 'config-env' ] ) ? $argv[ 'config-env' ] : $thisSection;
190
+        $thisSection = isset($argv['config-env']) ? $argv['config-env'] : $thisSection;
191 191
 
192
-        if ( isset( $configTemp[ $thisSection ][ 'extends' ] ) ) {
192
+        if (isset($configTemp[$thisSection]['extends'])) {
193 193
             #faz marge da config principal com a config extendida
194
-            return $configTemp[ $thisSection ] + $configTemp[ $configTemp[ $thisSection ][ 'extends' ] ];
194
+            return $configTemp[$thisSection] + $configTemp[$configTemp[$thisSection]['extends']];
195 195
         }
196 196
 
197
-        return $configTemp[ key ( $configTemp ) ];
197
+        return $configTemp[key($configTemp)];
198 198
     }
199 199
 
200 200
     /**
@@ -208,29 +208,29 @@  discard block
 block discarded – undo
208 208
      * @throws \Exception
209 209
      * @return array
210 210
      */
211
-    protected function loadIniFile ( $filename )
211
+    protected function loadIniFile($filename)
212 212
     {
213
-        if ( !is_file ( $filename ) ) {
214
-            throw new \Exception( "configuration file does not exist! \n" );
213
+        if ( ! is_file($filename)) {
214
+            throw new \Exception("configuration file does not exist! \n");
215 215
         }
216 216
 
217
-        $loaded   = parse_ini_file ( $filename, true );
218
-        $iniArray = array ();
219
-        foreach ( $loaded as $key => $data ) {
220
-            $pieces      = explode ( $this->sectionSeparator, $key );
221
-            $thisSection = trim ( $pieces[ 0 ] );
222
-            switch ( count ( $pieces ) ) {
217
+        $loaded   = parse_ini_file($filename, true);
218
+        $iniArray = array();
219
+        foreach ($loaded as $key => $data) {
220
+            $pieces      = explode($this->sectionSeparator, $key);
221
+            $thisSection = trim($pieces[0]);
222
+            switch (count($pieces)) {
223 223
                 case 1:
224
-                    $iniArray[ $thisSection ] = $data;
224
+                    $iniArray[$thisSection] = $data;
225 225
                     break;
226 226
 
227 227
                 case 2:
228
-                    $extendedSection          = trim ( $pieces[ 1 ] );
229
-                    $iniArray[ $thisSection ] = array_merge ( array ( 'extends' => $extendedSection ), $data );
228
+                    $extendedSection          = trim($pieces[1]);
229
+                    $iniArray[$thisSection] = array_merge(array('extends' => $extendedSection), $data);
230 230
                     break;
231 231
 
232 232
                 default:
233
-                    throw new \Exception( "Section '$thisSection' may not extend multiple sections in $filename" );
233
+                    throw new \Exception("Section '$thisSection' may not extend multiple sections in $filename");
234 234
             }
235 235
         }
236 236
 
@@ -243,15 +243,15 @@  discard block
 block discarded – undo
243 243
      * @return \Classes\AdapterConfig\AbstractAdapter
244 244
      *
245 245
      */
246
-    private function factoryConfig ()
246
+    private function factoryConfig()
247 247
     {
248
-        switch ( strtolower ( $this->argv[ 'framework' ] ) ) {
248
+        switch (strtolower($this->argv['framework'])) {
249 249
             case 'zf1':
250
-                return new ZendFrameworkOne( $this->argv );
250
+                return new ZendFrameworkOne($this->argv);
251 251
             case 'phalcon':
252
-                return new Phalcon( $this->argv );
252
+                return new Phalcon($this->argv);
253 253
             default:
254
-                return new None( $this->argv );
254
+                return new None($this->argv);
255 255
         }
256 256
 
257 257
     }
@@ -263,31 +263,31 @@  discard block
 block discarded – undo
263 263
      *
264 264
      * @return AdaptersDriver\AbsractAdapter
265 265
      */
266
-    private function factoryDriver ( AdapterConfig\AbstractAdapter $config )
266
+    private function factoryDriver(AdapterConfig\AbstractAdapter $config)
267 267
     {
268
-        switch ( $this->argv[ 'driver' ] ) {
268
+        switch ($this->argv['driver']) {
269 269
             case 'pgsql':
270 270
             case 'pdo_pgsql':
271
-                return new Pgsql( $config );
271
+                return new Pgsql($config);
272 272
             case 'mysql':
273 273
             case 'pdo_mysql':
274
-                return new Mysql( $config );
274
+                return new Mysql($config);
275 275
             case 'mssql':
276
-                return new Mssql( $config );
276
+                return new Mssql($config);
277 277
             case 'dblib':
278
-                return new Dblib( $config );
278
+                return new Dblib($config);
279 279
             case 'sqlsrv':
280
-                return new Sqlsrv( $config );
280
+                return new Sqlsrv($config);
281 281
         }
282 282
     }
283 283
 
284 284
     /**
285 285
      * @return AdapterConfig\AbstractAdapter
286 286
      */
287
-    public function getAdapterConfig ()
287
+    public function getAdapterConfig()
288 288
     {
289
-        if ( !$this->adapterConfig instanceof AbstractAdapter ) {
290
-            $this->adapterConfig = $this->factoryConfig ();
289
+        if ( ! $this->adapterConfig instanceof AbstractAdapter) {
290
+            $this->adapterConfig = $this->factoryConfig();
291 291
         }
292 292
 
293 293
         return $this->adapterConfig;
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
     /**
297 297
      * @return AdaptersDriver\AbsractAdapter
298 298
      */
299
-    public function getAdapterDriver ( AdapterConfig\AbstractAdapter $config )
299
+    public function getAdapterDriver(AdapterConfig\AbstractAdapter $config)
300 300
     {
301
-        if ( !$this->adapterDriver ) {
302
-            $this->adapterDriver = $this->factoryDriver ( $config );
301
+        if ( ! $this->adapterDriver) {
302
+            $this->adapterDriver = $this->factoryDriver($config);
303 303
         }
304 304
 
305 305
         return $this->adapterDriver;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -359,8 +359,7 @@
 block discarded – undo
359 359
         if ( is_null ( $this->_pdo ) ) {
360 360
             if ( !empty( $this->socket ) ) {
361 361
                 $pdoString = $this->getPDOSocketString ();
362
-            }
363
-            else {
362
+            } else {
364 363
                 $pdoString = $this->getPDOString ();
365 364
             }
366 365
 
Please login to merge, or discard this patch.
build/phar-generate.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( !ini_get ( 'short_open_tag' ) ) {
4
-    die( "please enable short_open_tag directive in php.ini\n" );
3
+if ( ! ini_get('short_open_tag')) {
4
+    die("please enable short_open_tag directive in php.ini\n");
5 5
 }
6 6
 
7
-if ( !ini_get ( 'register_argc_argv' ) ) {
8
-    die( "please enable register_argc_argv directive in php.ini\n" );
7
+if ( ! ini_get('register_argc_argv')) {
8
+    die("please enable register_argc_argv directive in php.ini\n");
9 9
 }
10 10
 
11
-if ( function_exists ( 'ini_set' ) ) {
12
-    @ini_set ( 'display_errors', 1 );
11
+if (function_exists('ini_set')) {
12
+    @ini_set('display_errors', 1);
13 13
 
14
-    $memoryInBytes = function ( $value ) {
15
-        $unit  = strtolower ( substr ( $value, -1, 1 ) );
14
+    $memoryInBytes = function($value) {
15
+        $unit  = strtolower(substr($value, -1, 1));
16 16
         $value = (int) $value;
17
-        switch ( $unit ) {
17
+        switch ($unit) {
18 18
             case 'g':
19 19
                 $value *= 1024;
20 20
             // no break (cumulative multiplier)
@@ -28,22 +28,22 @@  discard block
 block discarded – undo
28 28
         return $value;
29 29
     };
30 30
 
31
-    $memoryLimit = trim ( ini_get ( 'memory_limit' ) );
31
+    $memoryLimit = trim(ini_get('memory_limit'));
32 32
     // Increase memory_limit if it is lower than 1GB
33
-    if ( $memoryLimit != -1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 ) {
34
-        @ini_set ( 'memory_limit', '1G' );
33
+    if ($memoryLimit != -1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024) {
34
+        @ini_set('memory_limit', '1G');
35 35
     }
36
-    unset( $memoryInBytes, $memoryLimit );
36
+    unset($memoryInBytes, $memoryLimit);
37 37
 }
38 38
 
39
-\Phar::interceptFileFuncs ();
39
+\Phar::interceptFileFuncs();
40 40
 
41
-set_include_path (
42
-    implode (
41
+set_include_path(
42
+    implode(
43 43
         PATH_SEPARATOR,
44
-        array (
45
-            realpath ( __DIR__ ),
46
-            get_include_path (),
44
+        array(
45
+            realpath(__DIR__),
46
+            get_include_path(),
47 47
         )
48 48
     )
49 49
 );
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
 require_once 'Classes/MakerConfigFile.php';
54 54
 
55 55
 try {
56
-    $_path = realpath (
57
-        str_replace (
56
+    $_path = realpath(
57
+        str_replace(
58 58
             'phar://',
59 59
             '',
60 60
             __DIR__
61 61
         )
62 62
     );
63 63
 
64
-    $arrValid = array (
64
+    $arrValid = array(
65 65
         'version',
66 66
         'help',
67 67
         'status',
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
         'path:'
77 77
     );
78 78
 
79
-    $arg = getopt ( null, $arrValid );
80
-    if ( array_key_exists ( 'init', $arg ) ) {
81
-        $maker = new \Classes\MakerConfigFile( $arg, $_path );
79
+    $arg = getopt(null, $arrValid);
80
+    if (array_key_exists('init', $arg)) {
81
+        $maker = new \Classes\MakerConfigFile($arg, $_path);
82 82
     }
83 83
     else {
84
-        $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) );
84
+        $maker = new \Classes\MakerFile(new \Classes\Config($arg, $_path, count($argv)));
85 85
     }
86 86
 
87
-    $maker->run ();
87
+    $maker->run();
88 88
 
89
-} catch ( \Exception $e ) {
90
-    die( $e->getMessage () );
89
+} catch (\Exception $e) {
90
+    die($e->getMessage());
91 91
 }
92 92
 
93 93
 __halt_compiler();
94 94
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
     $arg = getopt ( null, $arrValid );
80 80
     if ( array_key_exists ( 'init', $arg ) ) {
81 81
         $maker = new \Classes\MakerConfigFile( $arg, $_path );
82
-    }
83
-    else {
82
+    } else {
84 83
         $maker = new \Classes\MakerFile( new \Classes\Config( $arg, $_path, count ( $argv ) ) );
85 84
     }
86 85
 
Please login to merge, or discard this patch.
generate.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
6 6
  * @author Pedro Alarcao <[email protected]>
7 7
  */
8 8
 
9
-if ( ! ini_get ( 'short_open_tag' ) )
9
+if ( ! ini_get('short_open_tag'))
10 10
 {
11
-    die( "please enable short_open_tag directive in php.ini\n" );
11
+    die("please enable short_open_tag directive in php.ini\n");
12 12
 }
13 13
 
14
-if ( ! ini_get ( 'register_argc_argv' ) )
14
+if ( ! ini_get('register_argc_argv'))
15 15
 {
16
-    die( "please enable register_argc_argv directive in php.ini\n" );
16
+    die("please enable register_argc_argv directive in php.ini\n");
17 17
 }
18 18
 
19 19
 
20
-if ( function_exists ( 'ini_set' ) )
20
+if (function_exists('ini_set'))
21 21
 {
22
-    @ini_set ( 'display_errors' , 1 );
22
+    @ini_set('display_errors', 1);
23 23
 
24
-    $memoryInBytes = function ( $value )
24
+    $memoryInBytes = function($value)
25 25
     {
26
-        $unit = strtolower ( substr ( $value , - 1 , 1 ) );
26
+        $unit = strtolower(substr($value, - 1, 1));
27 27
         $value = (int) $value;
28
-        switch ( $unit )
28
+        switch ($unit)
29 29
         {
30 30
             case 'g':
31 31
                 $value *= 1024;
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
         return $value;
41 41
     };
42 42
 
43
-    $memoryLimit = trim ( ini_get ( 'memory_limit' ) );
43
+    $memoryLimit = trim(ini_get('memory_limit'));
44 44
     // Increase memory_limit if it is lower than 1GB
45
-    if ( $memoryLimit != - 1 && $memoryInBytes( $memoryLimit ) < 1024 * 1024 * 1024 )
45
+    if ($memoryLimit != - 1 && $memoryInBytes($memoryLimit) < 1024 * 1024 * 1024)
46 46
     {
47
-        @ini_set ( 'memory_limit' , '1G' );
47
+        @ini_set('memory_limit', '1G');
48 48
     }
49
-    unset( $memoryInBytes , $memoryLimit );
49
+    unset($memoryInBytes, $memoryLimit);
50 50
 }
51 51
 
52
-set_include_path (
53
-    implode (
54
-        PATH_SEPARATOR ,
55
-        array (
56
-            realpath ( dirname ( __FILE__ ) . "/build/" ) ,
57
-            get_include_path () ,
52
+set_include_path(
53
+    implode(
54
+        PATH_SEPARATOR,
55
+        array(
56
+            realpath(dirname(__FILE__) . "/build/"),
57
+            get_include_path(),
58 58
         )
59 59
     )
60 60
 );
@@ -65,34 +65,34 @@  discard block
 block discarded – undo
65 65
 
66 66
 try
67 67
 {
68
-    $arrValid = array (
69
-        'version' ,
70
-        'help' ,
71
-        'status' ,
72
-        'init' ,
73
-        'config-env:' ,
74
-        'config-ini:' ,
75
-        'database:' ,
76
-        'schema:' ,
77
-        'driver:' ,
68
+    $arrValid = array(
69
+        'version',
70
+        'help',
71
+        'status',
72
+        'init',
73
+        'config-env:',
74
+        'config-ini:',
75
+        'database:',
76
+        'schema:',
77
+        'driver:',
78 78
         'tables:',
79
-        'framework:' ,
79
+        'framework:',
80 80
         'path:'
81 81
     );
82 82
 
83
-    $_path = realpath ( __FILE__ );
84
-    $arg   = getopt ( null , $arrValid );
85
-    if ( array_key_exists ( 'init' , $arg ) )
83
+    $_path = realpath(__FILE__);
84
+    $arg   = getopt(null, $arrValid);
85
+    if (array_key_exists('init', $arg))
86 86
     {
87
-        $maker = new \Classes\MakerConfigFile( $arg , $_path );
87
+        $maker = new \Classes\MakerConfigFile($arg, $_path);
88 88
     } else
89 89
     {
90
-        $maker = new \Classes\MakerFile( new \Classes\Config( $arg , $_path, count($argv) ) );
90
+        $maker = new \Classes\MakerFile(new \Classes\Config($arg, $_path, count($argv)));
91 91
     }
92 92
 
93
-    $maker->run ();
93
+    $maker->run();
94 94
 
95
-} catch ( \Exception $e )
95
+} catch (\Exception $e)
96 96
 {
97
-    die( $e->getMessage () );
97
+    die($e->getMessage());
98 98
 }
Please login to merge, or discard this patch.