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.
Passed
Push — master ( 5502fa...062bdf )
by Pedro
02:42
created
build/Classes/Config.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * @var array
51 51
      */
52
-    private $argv = array ();
52
+    private $argv = array();
53 53
 
54 54
     /**
55 55
      * @var \Classes\AdapterConfig\AbstractAdapter
@@ -61,18 +61,18 @@  discard block
 block discarded – undo
61 61
      */
62 62
     private $adapterDriver;
63 63
 
64
-    public function __construct ( $argv , $basePath )
64
+    public function __construct($argv, $basePath)
65 65
     {
66
-        if ( array_key_exists ( 'help' , $argv ) )
66
+        if (array_key_exists('help', $argv))
67 67
         {
68
-            die ( $this->getUsage () );
68
+            die ($this->getUsage());
69 69
         }
70
-        if ( array_key_exists ( 'status' , $argv ) )
70
+        if (array_key_exists('status', $argv))
71 71
         {
72
-            $argv[ 'status' ] = true;
72
+            $argv['status'] = true;
73 73
         }
74 74
 
75
-        $this->argv = $this->parseConfig ( $basePath , $argv );
75
+        $this->argv = $this->parseConfig($basePath, $argv);
76 76
     }
77 77
 
78 78
     /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return string
82 82
      */
83
-    public function getUsage ()
83
+    public function getUsage()
84 84
     {
85 85
         $version = static::$version;
86 86
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 EOF;
106 106
     }
107 107
 
108
-    public function getVersion ()
108
+    public function getVersion()
109 109
     {
110 110
         $version = static::$version;
111 111
 
@@ -121,22 +121,22 @@  discard block
 block discarded – undo
121 121
      * @return array
122 122
      * @throws \Exception
123 123
      */
124
-    private function parseConfig ( $basePath , $argv )
124
+    private function parseConfig($basePath, $argv)
125 125
     {
126
-        $this->_basePath = dirname ( $basePath );
126
+        $this->_basePath = dirname($basePath);
127 127
 
128
-        $configIni = isset( $argv[ 'config-ini' ] ) ? $argv[ 'config-ini' ]
128
+        $configIni = isset($argv['config-ini']) ? $argv['config-ini']
129 129
             : $this->_basePath . $this->configIniDefault;
130 130
 
131
-        $configTemp = $this->loadIniFile ( realpath ( $configIni ) );
132
-        $configCurrent = self::parseConfigEnv ( $configTemp , $argv );
131
+        $configTemp = $this->loadIniFile(realpath($configIni));
132
+        $configCurrent = self::parseConfigEnv($configTemp, $argv);
133 133
 
134
-        if ( ! isset( $configCurrent[ 'framework' ] ) )
134
+        if ( ! isset($configCurrent['framework']))
135 135
         {
136
-            throw new \Exception( "configure which framework you want to use! \n" );
136
+            throw new \Exception("configure which framework you want to use! \n");
137 137
         }
138 138
 
139
-        return $argv + array_filter ( $configCurrent );
139
+        return $argv + array_filter($configCurrent);
140 140
     }
141 141
 
142 142
     /**
@@ -146,22 +146,22 @@  discard block
 block discarded – undo
146 146
      *
147 147
      * @return string
148 148
      */
149
-    private static function parseConfigEnv ( $configTemp , $argv )
149
+    private static function parseConfigEnv($configTemp, $argv)
150 150
     {
151
-        $thisSection = isset( $configTemp[ key ( $configTemp ) ][ 'config-env' ] ) ?
152
-            $configTemp[ key ( $configTemp ) ][ 'config-env' ] : null;
151
+        $thisSection = isset($configTemp[key($configTemp)]['config-env']) ?
152
+            $configTemp[key($configTemp)]['config-env'] : null;
153 153
 
154
-        $thisSection = isset( $argv[ 'config-env' ] ) ? $argv[ 'config-env' ]
154
+        $thisSection = isset($argv['config-env']) ? $argv['config-env']
155 155
             : $thisSection;
156 156
 
157
-        if ( isset( $configTemp[ $thisSection ][ 'extends' ] ) )
157
+        if (isset($configTemp[$thisSection]['extends']))
158 158
         {
159 159
             #faz marge da config principal com a config extendida
160
-            return $configTemp[ $thisSection ]
161
-                   + $configTemp[ $configTemp[ $thisSection ][ 'extends' ] ];
160
+            return $configTemp[$thisSection]
161
+                   + $configTemp[$configTemp[$thisSection]['extends']];
162 162
         }
163 163
 
164
-        return $configTemp[ key ( $configTemp ) ];
164
+        return $configTemp[key($configTemp)];
165 165
     }
166 166
 
167 167
     /**
@@ -175,32 +175,32 @@  discard block
 block discarded – undo
175 175
      * @throws \Exception
176 176
      * @return array
177 177
      */
178
-    protected function loadIniFile ( $filename )
178
+    protected function loadIniFile($filename)
179 179
     {
180
-        if ( ! is_file ( $filename ) )
180
+        if ( ! is_file($filename))
181 181
         {
182
-            throw new \Exception( "configuration file does not exist! \n" );
182
+            throw new \Exception("configuration file does not exist! \n");
183 183
         }
184 184
 
185
-        $loaded = parse_ini_file ( $filename , true );
186
-        $iniArray = array ();
187
-        foreach ( $loaded as $key => $data )
185
+        $loaded = parse_ini_file($filename, true);
186
+        $iniArray = array();
187
+        foreach ($loaded as $key => $data)
188 188
         {
189
-            $pieces = explode ( $this->sectionSeparator , $key );
190
-            $thisSection = trim ( $pieces[ 0 ] );
191
-            switch ( count ( $pieces ) )
189
+            $pieces = explode($this->sectionSeparator, $key);
190
+            $thisSection = trim($pieces[0]);
191
+            switch (count($pieces))
192 192
             {
193 193
                 case 1:
194
-                    $iniArray[ $thisSection ] = $data;
194
+                    $iniArray[$thisSection] = $data;
195 195
                     break;
196 196
 
197 197
                 case 2:
198
-                    $extendedSection = trim ( $pieces[ 1 ] );
199
-                    $iniArray[ $thisSection ] = array_merge ( array ( 'extends' => $extendedSection ) , $data );
198
+                    $extendedSection = trim($pieces[1]);
199
+                    $iniArray[$thisSection] = array_merge(array('extends' => $extendedSection), $data);
200 200
                     break;
201 201
 
202 202
                 default:
203
-                    throw new \Exception( "Section '$thisSection' may not extend multiple sections in $filename" );
203
+                    throw new \Exception("Section '$thisSection' may not extend multiple sections in $filename");
204 204
             }
205 205
         }
206 206
 
@@ -211,15 +211,15 @@  discard block
 block discarded – undo
211 211
      * analisa a opção e cria a instancia do Atapter do determinado framework
212 212
      *
213 213
      */
214
-    private function factoryConfig ()
214
+    private function factoryConfig()
215 215
     {
216
-        switch ( strtolower ( $this->argv[ 'framework' ] ) )
216
+        switch (strtolower($this->argv['framework']))
217 217
         {
218 218
             case 'none':
219
-                $this->adapterConfig = new None( $this->argv );
219
+                $this->adapterConfig = new None($this->argv);
220 220
                 break;
221 221
             case 'zend_framework':
222
-                $this->adapterConfig = new ZendFrameworkOne( $this->argv );
222
+                $this->adapterConfig = new ZendFrameworkOne($this->argv);
223 223
                 break;
224 224
         }
225 225
 
@@ -229,17 +229,17 @@  discard block
 block discarded – undo
229 229
      * Analisa a opção e instancia o determinado banco de dados
230 230
      *
231 231
      */
232
-    private function factoryDriver ()
232
+    private function factoryDriver()
233 233
     {
234
-        switch ( $this->argv[ 'driver' ] )
234
+        switch ($this->argv['driver'])
235 235
         {
236 236
             case 'pgsql':
237
-            case 'pdo_pgsql': $this->adapterDriver = new Pgsql( $this->getAdapterConfig () ); break;
237
+            case 'pdo_pgsql': $this->adapterDriver = new Pgsql($this->getAdapterConfig()); break;
238 238
             case 'mysql':
239
-            case 'pdo_mysql': $this->adapterDriver = new Mysql( $this->getAdapterConfig () ); break;
240
-            case 'mssql': $this->adapterDriver = new Mssql( $this->getAdapterConfig () ); break;
241
-            case 'dblib':$this->adapterDriver = new Dblib( $this->getAdapterConfig () ); break;
242
-            case 'sqlsrv': $this->adapterDriver = new Sqlsrv( $this->getAdapterConfig () ); break;
239
+            case 'pdo_mysql': $this->adapterDriver = new Mysql($this->getAdapterConfig()); break;
240
+            case 'mssql': $this->adapterDriver = new Mssql($this->getAdapterConfig()); break;
241
+            case 'dblib':$this->adapterDriver = new Dblib($this->getAdapterConfig()); break;
242
+            case 'sqlsrv': $this->adapterDriver = new Sqlsrv($this->getAdapterConfig()); break;
243 243
         }
244 244
 
245 245
     }
@@ -247,11 +247,11 @@  discard block
 block discarded – undo
247 247
     /**
248 248
      * @return AdapterConfig\AbstractAdapter
249 249
      */
250
-    public function getAdapterConfig ()
250
+    public function getAdapterConfig()
251 251
     {
252
-        if ( ! $this->adapterConfig )
252
+        if ( ! $this->adapterConfig)
253 253
         {
254
-            $this->factoryConfig ();
254
+            $this->factoryConfig();
255 255
         }
256 256
 
257 257
         return $this->adapterConfig;
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
     /**
261 261
      * @return AdaptersDriver\AbsractAdapter
262 262
      */
263
-    public function getAdapterDriver ()
263
+    public function getAdapterDriver()
264 264
     {
265
-        if ( ! $this->adapterDriver )
265
+        if ( ! $this->adapterDriver)
266 266
         {
267
-            $this->factoryDriver ();
267
+            $this->factoryDriver();
268 268
         }
269 269
 
270 270
         return $this->adapterDriver;
Please login to merge, or discard this patch.