Completed
Push — develop ( 18312c...2a20d3 )
by greg
13:17
created
src/PlaygroundCore/Module.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                     if (empty($locale) && in_array('cookie', $pgstrat)) {
56 56
                         $serviceManager->get('router')->setTranslator($translator);
57 57
                         if ($serviceManager->get('router')->match($serviceManager->get('request')) &&
58
-                            strpos($serviceManager->get('router')->match($serviceManager->get('request'))->getMatchedRouteName(), 'admin') !==false
58
+                            strpos($serviceManager->get('router')->match($serviceManager->get('request'))->getMatchedRouteName(), 'admin') !== false
59 59
                         ) {
60 60
                             if ($e->getRequest()->getCookie() &&
61 61
                                 $e->getRequest()->getCookie()->offsetExists('pg_locale_back')
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         // Google Analytics : When the render event is triggered, we invoke the view helper to
156 156
         // render the javascript code.
157
-        $e->getApplication()->getEventManager()->attach(\Zend\Mvc\MvcEvent::EVENT_RENDER, function (\Zend\Mvc\MvcEvent $e) use ($serviceManager) {
157
+        $e->getApplication()->getEventManager()->attach(\Zend\Mvc\MvcEvent::EVENT_RENDER, function(\Zend\Mvc\MvcEvent $e) use ($serviceManager) {
158 158
             $view   = $serviceManager->get('ViewHelperManager');
159 159
             $plugin = $view->get('googleAnalytics');
160 160
             $plugin();
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
                 // that they need to send the user back to FB...
182 182
 
183 183
                 if (!count($_COOKIE) > 0 && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari')) {
184
-                    echo '<script type="text/javascript">' .
185
-                    'window.top.location.href = window.location.href+"?redir_fb_page_id='. $data["page"]["id"]. '";' .
184
+                    echo '<script type="text/javascript">'.
185
+                    'window.top.location.href = window.location.href+"?redir_fb_page_id='.$data["page"]["id"].'";'.
186 186
                     '</script>';
187 187
                 }
188 188
 
@@ -199,11 +199,11 @@  discard block
 block discarded – undo
199 199
     {
200 200
         return array(
201 201
             'Zend\Loader\ClassMapAutoloader' => array(
202
-                __DIR__ . '/../../autoload_classmap.php',
202
+                __DIR__.'/../../autoload_classmap.php',
203 203
             ),
204 204
             'Zend\Loader\StandardAutoloader' => array(
205 205
                 'namespaces' => array(
206
-                    __NAMESPACE__ => __DIR__ . '/../../src/' . __NAMESPACE__,
206
+                    __NAMESPACE__ => __DIR__.'/../../src/'.__NAMESPACE__,
207 207
                 ),
208 208
             ),
209 209
         );
@@ -211,21 +211,21 @@  discard block
 block discarded – undo
211 211
 
212 212
     public function getConfig()
213 213
     {
214
-        return include __DIR__ . '/../../config/module.config.php';
214
+        return include __DIR__.'/../../config/module.config.php';
215 215
     }
216 216
 
217 217
     public function getViewHelperConfig()
218 218
     {
219 219
         return array(
220 220
             'factories' => array(
221
-                'QgCKEditor' => function (\Zend\ServiceManager\ServiceManager $sm) {
221
+                'QgCKEditor' => function(\Zend\ServiceManager\ServiceManager $sm) {
222 222
                     $config = $sm->getServiceLocator()->get('config');
223 223
                     $QuCk = new View\Helper\AdCKEditor($config['playgroundcore']['ckeditor']);
224 224
 
225 225
                     return $QuCk;
226 226
                 },
227 227
 
228
-                'googleAnalytics' => function (\Zend\ServiceManager\ServiceManager $sm) {
228
+                'googleAnalytics' => function(\Zend\ServiceManager\ServiceManager $sm) {
229 229
                     $tracker = $sm->getServiceLocator()->get('google-analytics');
230 230
     
231 231
                     $helper  = new View\Helper\GoogleAnalytics($tracker, $sm->getServiceLocator()->get('Request'));
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                     return $helper;
234 234
                 },
235 235
 
236
-                'facebookOpengraph' => function (\Zend\ServiceManager\ServiceManager $sm) {
236
+                'facebookOpengraph' => function(\Zend\ServiceManager\ServiceManager $sm) {
237 237
                     $tracker = $sm->getServiceLocator()->get('facebook-opengraph');
238 238
 
239 239
                     $helper  = new View\Helper\FacebookOpengraph($tracker, $sm->getServiceLocator()->get('Request'));
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
                     return $helper;
242 242
                 },
243 243
                 
244
-                'twitterCard' => function (\Zend\ServiceManager\ServiceManager $sm) {
244
+                'twitterCard' => function(\Zend\ServiceManager\ServiceManager $sm) {
245 245
                     $viewHelper = new View\Helper\TwitterCard();
246 246
                     $viewHelper->setConfig($sm->getServiceLocator()->get('twitter-card'));
247 247
                     $viewHelper->setRequest($sm->getServiceLocator()->get('Request'));
248 248
                     return $viewHelper;
249 249
                 },
250 250
 
251
-                'switchLocaleWidget' => function (\Zend\ServiceManager\ServiceManager $sm) {
251
+                'switchLocaleWidget' => function(\Zend\ServiceManager\ServiceManager $sm) {
252 252
                     $viewHelper = new View\Helper\SwitchLocaleWidget();
253 253
                     $viewHelper->setLocaleService($sm->getServiceLocator()->get('playgroundcore_locale_service'));
254 254
                     $viewHelper->setWebsiteService($sm->getServiceLocator()->get('playgroundcore_website_service'));
@@ -290,43 +290,43 @@  discard block
 block discarded – undo
290 290
                     'playgroundcore_ffmpeg_service'      => 'PlaygroundCore\Service\Ffmpeg',
291 291
                 ),
292 292
                 'factories' => array(
293
-                    'playgroundcore_module_options' => function (\Zend\ServiceManager\ServiceManager $sm) {
293
+                    'playgroundcore_module_options' => function(\Zend\ServiceManager\ServiceManager $sm) {
294 294
                         $config = $sm->get('Configuration');
295 295
 
296 296
                         return new Options\ModuleOptions(isset($config['playgroundcore']) ? $config['playgroundcore'] : array());
297 297
                     },
298 298
 
299
-                    'playgroundcore_formgen_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
299
+                    'playgroundcore_formgen_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
300 300
                         return new Mapper\Formgen($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
301 301
                     },
302 302
 
303
-                    'playgroundcore_website_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
303
+                    'playgroundcore_website_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
304 304
 
305 305
                         return new Mapper\Website($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
306 306
                     },
307 307
 
308
-                    'playgroundcore_locale_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
308
+                    'playgroundcore_locale_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
309 309
                         return new Mapper\Locale($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
310 310
                     },
311 311
 
312 312
                     'playgroundcore_twilio' => 'PlaygroundCore\Service\Factory\TwilioServiceFactory',
313 313
                     'playgroundcore_phpvideotoolkit' => 'PlaygroundCore\Service\Factory\PhpvideotoolkitServiceFactory',
314 314
                     'playgroundcore_transport' => 'PlaygroundCore\Mail\Transport\Service\TransportFactory',
315
-                    'PlaygroundCore\Analytics\Tracker' => function (\Zend\ServiceManager\ServiceManager $sm) {
315
+                    'PlaygroundCore\Analytics\Tracker' => function(\Zend\ServiceManager\ServiceManager $sm) {
316 316
                         $config = $sm->get('config');
317 317
                         $config = isset($config['playgroundcore']) ? $config['playgroundcore']['googleAnalytics'] : array('id' => 'UA-XXXXXXXX-X');
318 318
 
319 319
                         $tracker = new Analytics\Tracker($config['id']);
320 320
 
321
-                        if(isset($config['enable_tracking'])){
321
+                        if (isset($config['enable_tracking'])) {
322 322
                             $tracker->setEnableTracking($config['enable_tracking']);
323 323
                         }
324 324
 
325 325
                         if (isset($config['custom_vars'])) {
326 326
                             foreach ($config['custom_vars'] as $customVar) {
327 327
                                 $customVarId        = $customVar['id'];
328
-                                $customVarName        = $customVar['name'];
329
-                                $customVarValue    = $customVar['value'];
328
+                                $customVarName = $customVar['name'];
329
+                                $customVarValue = $customVar['value'];
330 330
                                 $customVarOptScope  = $customVar['optScope'];
331 331
                                 $customVar = new Analytics\CustomVar($customVarId, $customVarName, $customVarValue, $customVarOptScope);
332 332
                                 $tracker->addCustomVar($customVar);
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
                         return $tracker;
349 349
                     },
350
-                    'PlaygroundCore\Opengraph\Tracker' => function (\Zend\ServiceManager\ServiceManager $sm) {
350
+                    'PlaygroundCore\Opengraph\Tracker' => function(\Zend\ServiceManager\ServiceManager $sm) {
351 351
                         $config = $sm->get('config');
352 352
                         $config = isset($config['playgroundcore']['facebookOpengraph']) ? $config['playgroundcore']['facebookOpengraph'] : array('appId' => '');
353 353
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 
367 367
                         return $tracker;
368 368
                     },
369
-                    'PlaygroundCore\TwitterCard\Config' => function (\Zend\ServiceManager\ServiceManager $sm) {
369
+                    'PlaygroundCore\TwitterCard\Config' => function(\Zend\ServiceManager\ServiceManager $sm) {
370 370
                         $config = $sm->get('config');
371 371
                         $config = isset($config['playgroundcore']['twitterCard']) ? $config['playgroundcore']['twitterCard'] : array();
372 372
                         return new TwitterCard\Config($config);
Please login to merge, or discard this patch.