Completed
Push — develop ( a1e42e...19866e )
by greg
03:14
created
src/PlaygroundCore/Mapper/Website.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
 class Website extends AbstractMapper
8 8
 {
9 9
     /**
10
-    * getEntityRepository : recupere l'entite website
11
-    *
12
-    * @return PlaygroundCore\Entity\Website $website
13
-    */
10
+     * getEntityRepository : recupere l'entite website
11
+     *
12
+     * @return PlaygroundCore\Entity\Website $website
13
+     */
14 14
     public function getEntityRepository()
15 15
     {
16 16
         if (null === $this->er) {
Please login to merge, or discard this patch.
src/PlaygroundCore/Module.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             //translator
34 34
 
35 35
             // Gestion locale pour le back
36
-            if ($serviceManager->get('router')->match($serviceManager->get('request')) && strpos($serviceManager->get('router')->match($serviceManager->get('request'))->getMatchedRouteName(), 'admin') !==false) {
36
+            if ($serviceManager->get('router')->match($serviceManager->get('request')) && strpos($serviceManager->get('router')->match($serviceManager->get('request'))->getMatchedRouteName(), 'admin') !== false) {
37 37
                 if ($e->getRequest()->getCookie() && $e->getRequest()->getCookie()->offsetExists('pg_locale_back')) {
38 38
                     $locale = $e->getRequest()->getCookie()->offsetGet('pg_locale_back');
39 39
                 }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         // Google Analytics : When the render event is triggered, we invoke the view helper to
103 103
         // render the javascript code.
104
-        $e->getApplication()->getEventManager()->attach(\Zend\Mvc\MvcEvent::EVENT_RENDER, function (\Zend\Mvc\MvcEvent $e) use ($serviceManager) {
104
+        $e->getApplication()->getEventManager()->attach(\Zend\Mvc\MvcEvent::EVENT_RENDER, function(\Zend\Mvc\MvcEvent $e) use ($serviceManager) {
105 105
             $view   = $serviceManager->get('ViewHelperManager');
106 106
             $plugin = $view->get('googleAnalytics');
107 107
             $plugin();
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
                 // that they need to send the user back to FB...
129 129
 
130 130
                 if (!count($_COOKIE) > 0 && strpos($_SERVER['HTTP_USER_AGENT'], 'Safari')) {
131
-                    echo '<script type="text/javascript">' .
132
-                    'window.top.location.href = window.location.href+"?redir_fb_page_id='. $data["page"]["id"]. '";' .
131
+                    echo '<script type="text/javascript">'.
132
+                    'window.top.location.href = window.location.href+"?redir_fb_page_id='.$data["page"]["id"].'";'.
133 133
                     '</script>';
134 134
                 }
135 135
 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
     {
147 147
         return array(
148 148
             'Zend\Loader\ClassMapAutoloader' => array(
149
-                __DIR__ . '/../../autoload_classmap.php',
149
+                __DIR__.'/../../autoload_classmap.php',
150 150
             ),
151 151
             'Zend\Loader\StandardAutoloader' => array(
152 152
                 'namespaces' => array(
153
-                    __NAMESPACE__ => __DIR__ . '/../../src/' . __NAMESPACE__,
153
+                    __NAMESPACE__ => __DIR__.'/../../src/'.__NAMESPACE__,
154 154
                 ),
155 155
             ),
156 156
         );
@@ -158,21 +158,21 @@  discard block
 block discarded – undo
158 158
 
159 159
     public function getConfig()
160 160
     {
161
-        return include __DIR__ . '/../../config/module.config.php';
161
+        return include __DIR__.'/../../config/module.config.php';
162 162
     }
163 163
 
164 164
     public function getViewHelperConfig()
165 165
     {
166 166
         return array(
167 167
             'factories' => array(
168
-                'QgCKEditor' => function (\Zend\ServiceManager\ServiceManager $sm) {
168
+                'QgCKEditor' => function(\Zend\ServiceManager\ServiceManager $sm) {
169 169
                     $config = $sm->getServiceLocator()->get('config');
170 170
                     $QuCk = new View\Helper\AdCKEditor($config['playgroundcore']['ckeditor']);
171 171
 
172 172
                     return $QuCk;
173 173
                 },
174 174
 
175
-                'googleAnalytics' => function (\Zend\ServiceManager\ServiceManager $sm) {
175
+                'googleAnalytics' => function(\Zend\ServiceManager\ServiceManager $sm) {
176 176
                     $tracker = $sm->getServiceLocator()->get('google-analytics');
177 177
     
178 178
                     $helper  = new View\Helper\GoogleAnalytics($tracker, $sm->getServiceLocator()->get('Request'));
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                     return $helper;
181 181
                 },
182 182
 
183
-                'facebookOpengraph' => function (\Zend\ServiceManager\ServiceManager $sm) {
183
+                'facebookOpengraph' => function(\Zend\ServiceManager\ServiceManager $sm) {
184 184
                     $tracker = $sm->getServiceLocator()->get('facebook-opengraph');
185 185
 
186 186
                     $helper  = new View\Helper\FacebookOpengraph($tracker, $sm->getServiceLocator()->get('Request'));
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
                     return $helper;
189 189
                 },
190 190
                 
191
-                'twitterCard' => function (\Zend\ServiceManager\ServiceManager $sm) {
191
+                'twitterCard' => function(\Zend\ServiceManager\ServiceManager $sm) {
192 192
                     $viewHelper = new View\Helper\TwitterCard();
193 193
                     $viewHelper->setConfig($sm->getServiceLocator()->get('twitter-card'));
194 194
                     $viewHelper->setRequest($sm->getServiceLocator()->get('Request'));
195 195
                     return $viewHelper;
196 196
                 },
197 197
 
198
-                'switchLocaleWidget' => function (\Zend\ServiceManager\ServiceManager $sm) {
198
+                'switchLocaleWidget' => function(\Zend\ServiceManager\ServiceManager $sm) {
199 199
                     $viewHelper = new View\Helper\SwitchLocaleWidget();
200 200
                     $viewHelper->setLocaleService($sm->getServiceLocator()->get('playgroundcore_locale_service'));
201 201
                     $viewHelper->setWebsiteService($sm->getServiceLocator()->get('playgroundcore_website_service'));
@@ -237,29 +237,29 @@  discard block
 block discarded – undo
237 237
                     'playgroundcore_ffmpeg_service'      => 'PlaygroundCore\Service\Ffmpeg',
238 238
                 ),
239 239
                 'factories' => array(
240
-                    'playgroundcore_module_options' => function (\Zend\ServiceManager\ServiceManager $sm) {
240
+                    'playgroundcore_module_options' => function(\Zend\ServiceManager\ServiceManager $sm) {
241 241
                         $config = $sm->get('Configuration');
242 242
 
243 243
                         return new Options\ModuleOptions(isset($config['playgroundcore']) ? $config['playgroundcore'] : array());
244 244
                     },
245 245
 
246
-                    'playgroundcore_formgen_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
246
+                    'playgroundcore_formgen_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
247 247
                         return new Mapper\Formgen($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
248 248
                     },
249 249
 
250
-                    'playgroundcore_website_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
250
+                    'playgroundcore_website_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
251 251
 
252 252
                         return new Mapper\Website($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
253 253
                     },
254 254
 
255
-                    'playgroundcore_locale_mapper' => function (\Zend\ServiceManager\ServiceManager $sm) {
255
+                    'playgroundcore_locale_mapper' => function(\Zend\ServiceManager\ServiceManager $sm) {
256 256
                         return new Mapper\Locale($sm->get('playgroundcore_doctrine_em'), $sm->get('playgroundcore_module_options'));
257 257
                     },
258 258
 
259 259
                     'playgroundcore_twilio' => 'PlaygroundCore\Service\Factory\TwilioServiceFactory',
260 260
                     'playgroundcore_phpvideotoolkit' => 'PlaygroundCore\Service\Factory\PhpvideotoolkitServiceFactory',
261 261
                     'playgroundcore_transport' => 'PlaygroundCore\Mail\Transport\Service\TransportFactory',
262
-                    'PlaygroundCore\Analytics\Tracker' => function (\Zend\ServiceManager\ServiceManager $sm) {
262
+                    'PlaygroundCore\Analytics\Tracker' => function(\Zend\ServiceManager\ServiceManager $sm) {
263 263
                         $config = $sm->get('config');
264 264
                         $config = isset($config['playgroundcore']) ? $config['playgroundcore']['googleAnalytics'] : array('id' => 'UA-XXXXXXXX-X');
265 265
 
@@ -268,8 +268,8 @@  discard block
 block discarded – undo
268 268
                         if (isset($config['custom_vars'])) {
269 269
                             foreach ($config['custom_vars'] as $customVar) {
270 270
                                 $customVarId        = $customVar['id'];
271
-                                $customVarName        = $customVar['name'];
272
-                                $customVarValue    = $customVar['value'];
271
+                                $customVarName = $customVar['name'];
272
+                                $customVarValue = $customVar['value'];
273 273
                                 $customVarOptScope  = $customVar['optScope'];
274 274
                                 $customVar = new Analytics\CustomVar($customVarId, $customVarName, $customVarValue, $customVarOptScope);
275 275
                                 $tracker->addCustomVar($customVar);
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 
291 291
                         return $tracker;
292 292
                     },
293
-                    'PlaygroundCore\Opengraph\Tracker' => function (\Zend\ServiceManager\ServiceManager $sm) {
293
+                    'PlaygroundCore\Opengraph\Tracker' => function(\Zend\ServiceManager\ServiceManager $sm) {
294 294
                         $config = $sm->get('config');
295 295
                         $config = isset($config['playgroundcore']['facebookOpengraph']) ? $config['playgroundcore']['facebookOpengraph'] : array('appId' => '');
296 296
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
                         return $tracker;
311 311
                     },
312
-                    'PlaygroundCore\TwitterCard\Config' => function (\Zend\ServiceManager\ServiceManager $sm) {
312
+                    'PlaygroundCore\TwitterCard\Config' => function(\Zend\ServiceManager\ServiceManager $sm) {
313 313
                         $config = $sm->get('config');
314 314
                         $config = isset($config['playgroundcore']['twitterCard']) ? $config['playgroundcore']['twitterCard'] : array();
315 315
                         return new TwitterCard\Config($config);
Please login to merge, or discard this patch.
src/PlaygroundCore/Mvc/Router/Http/RegexSlash.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Zend Framework (http://framework.zend.com/)
4
- *
5
- * @link      http://github.com/zendframework/zf2 for the canonical source repository
6
- * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7
- * @license   http://framework.zend.com/license/new-bsd New BSD License
8
- */
3
+     * Zend Framework (http://framework.zend.com/)
4
+     *
5
+     * @link      http://github.com/zendframework/zf2 for the canonical source repository
6
+     * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7
+     * @license   http://framework.zend.com/license/new-bsd New BSD License
8
+     */
9 9
 
10 10
 namespace PlaygroundCore\Mvc\Router\Http;
11 11
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         $this->assembledParams = array();
46 46
 
47 47
         foreach ($mergedParams as $key => $value) {
48
-            $spec = '%' . $key . '%';
48
+            $spec = '%'.$key.'%';
49 49
 
50 50
             if (strpos($url, $spec) !== false) {
51 51
                 $url = str_replace($spec, rawurlencode($value), $url);
Please login to merge, or discard this patch.
src/PlaygroundCore/Options/ModuleOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $bitlyUrl      = 'http://api.bit.ly/v3/shorten';
12 12
     protected $transport_class = 'Zend\Mail\Transport\File';
13 13
     protected $options_class   = 'Zend\Mail\Transport\FileOptions';
14
-    protected $options   = array('path' => 'data/mail/');
14
+    protected $options = array('path' => 'data/mail/');
15 15
     protected $twilio = array();
16 16
     protected $phpvideotoolkit = array();
17 17
     protected $quConfig = array();
Please login to merge, or discard this patch.
src/PlaygroundCore/Service/CKEditor.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created,
71 71
      * it will be displayed to anyone with JavaScript disabled or with incompatible browser.
72 72
      */
73
-    public $textareaAttributes = array( "rows" => 8, "cols" => 60 );
73
+    public $textareaAttributes = array("rows" => 8, "cols" => 60);
74 74
     /**
75 75
      * A string indicating the creation date of %CKEditor.
76 76
      * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $attr = "";
132 132
         foreach ($this->textareaAttributes as $key => $val) {
133
-            $attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
133
+            $attr .= " ".$key.'="'.str_replace('"', '&quot;', $val).'"';
134 134
         }
135
-        $out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
135
+        $out = "<textarea name=\"".$name."\"".$attr.">".htmlspecialchars($value)."</textarea>\n";
136 136
         if (!$this->initialized) {
137 137
             $out .= $this->init();
138 138
         }
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
         } else {
231 231
             $js .= "CKEDITOR.replaceAll( function (textarea, config) {\n";
232 232
             if (!empty($className)) {
233
-                $js .= "	var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
233
+                $js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
234 234
                 $js .= "	if (!classRegex.test(textarea.className))\n";
235 235
                 $js .= "		return false;\n";
236 236
             }
237
-            $js .= "	CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
237
+            $js .= "	CKEDITOR.tools.extend(config, ".$this->jsEncode($_config).", true);";
238 238
             $js .= "} );";
239 239
         }
240 240
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
                     }
411 411
                     // Return only new events
412 412
                     if (!in_array($code, $returnedEvents[$eventName])) {
413
-                        $out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
413
+                        $out .= ($code ? "\n" : "")."CKEDITOR.on('".$eventName."', $code);";
414 414
                         $returnedEvents[$eventName][] = $code;
415 415
                     }
416 416
                 }
@@ -442,19 +442,19 @@  discard block
 block discarded – undo
442 442
         $ckeditorPath = $this->ckeditorPath();
443 443
 
444 444
         if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
445
-            $args = '?t=' . $this->timestamp;
445
+            $args = '?t='.$this->timestamp;
446 446
         }
447 447
 
448 448
         // Skip relative paths...
449 449
         if (strpos($ckeditorPath, '..') !== 0) {
450
-            $out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
450
+            $out .= $this->script("window.CKEDITOR_BASEPATH='".$ckeditorPath."';");
451 451
         }
452 452
 
453
-        $out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
453
+        $out .= "<script type=\"text/javascript\" src=\"".$ckeditorPath.'ckeditor.js'.$args."\"></script>\n";
454 454
 
455 455
         $extraCode = "";
456 456
         if ($this->timestamp != self::TIMESTAMP) {
457
-            $extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
457
+            $extraCode .= ($extraCode ? "\n" : "")."CKEDITOR.timestamp = '".$this->timestamp."';";
458 458
         }
459 459
         if ($extraCode) {
460 460
             $out .= $this->script($extraCode);
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
             /**
486 486
              * realpath - Returns canonicalized absolute pathname
487 487
              */
488
-            $realPath = realpath('./') ;
488
+            $realPath = realpath('./');
489 489
         }
490 490
 
491 491
         /**
@@ -528,15 +528,15 @@  discard block
 block discarded – undo
528 528
             return str_replace(',', '.', $val);
529 529
         }
530 530
         if (is_array($val) || is_object($val)) {
531
-            if (is_array($val) && (array_keys($val) === range(0, count($val)-1))) {
532
-                return '[' . implode(',', array_map(array($this, 'jsEncode'), $val)) . ']';
531
+            if (is_array($val) && (array_keys($val) === range(0, count($val) - 1))) {
532
+                return '['.implode(',', array_map(array($this, 'jsEncode'), $val)).']';
533 533
             }
534 534
             $temp = array();
535 535
             foreach ($val as $k => $v) {
536
-                $temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v);
536
+                $temp[] = $this->jsEncode("{$k}").':'.$this->jsEncode($v);
537 537
             }
538 538
 
539
-            return '{' . implode(',', $temp) . '}';
539
+            return '{'.implode(',', $temp).'}';
540 540
         }
541 541
         // String otherwise
542 542
         if (strpos($val, '@@') === 0) {
@@ -546,6 +546,6 @@  discard block
 block discarded – undo
546 546
             return $val;
547 547
         }
548 548
 
549
-        return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
549
+        return '"'.str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val).'"';
550 550
     }
551 551
 }
Please login to merge, or discard this patch.
src/PlaygroundCore/Service/Ffmpeg.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             ->addPreInputCommand('-pattern_type', 'glob')
73 73
             ->addCommand('-i', $path)
74 74
             ->addCommand('-c:v', 'libx264')
75
-            ->addCommand('-vf', 'fps='. $fps)
75
+            ->addCommand('-vf', 'fps='.$fps)
76 76
             ->addCommand('-pix_fmt', 'yuv420p')
77 77
             ->setOutputPath($target)
78 78
             ->execute();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             ->addPreInputCommand('-pattern_type', 'glob')
105 105
             ->addCommand('-i', $path)
106 106
             ->addCommand('-vcodec', 'qtrle')
107
-            ->addCommand('-vf', 'fps='. $fps)
107
+            ->addCommand('-vf', 'fps='.$fps)
108 108
             ->setOutputPath($target)
109 109
             ->execute();
110 110
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                 $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
179 179
                 $this->getServiceManager()->get('playgroundcore_phpvideotoolkit')
180 180
                     ->addPreInputCommand('-y')
181
-                    ->addCommand('-i', 'concat:' . implode('|', $videos))
181
+                    ->addCommand('-i', 'concat:'.implode('|', $videos))
182 182
                     ->addCommand('-c', 'copy')
183 183
                     ->addCommand('-bsf:a', 'aac_adtstoasc')
184 184
                     ->addCommand('-bufsize', '1835k')
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         foreach ($layer as $k => $l) {
294 294
             $ffmpeg->addCommand('-i', $l, true);
295 295
             $overlay .= 'overlay=format=rgb';
296
-            if ($k<count($layer)-1) {
296
+            if ($k < count($layer) - 1) {
297 297
                 $overlay .= ',';
298 298
             }
299 299
         }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             $ffmpeg->addCommand('-i', $s, true);
388 388
             $concat .= '['.$k.':0]';
389 389
         }
390
-        $concat .= 'concat=n='. count($sounds) .':v=0:a=1[out]';
390
+        $concat .= 'concat=n='.count($sounds).':v=0:a=1[out]';
391 391
 
392 392
         $ffmpeg->addCommand('-filter_complex', $concat)
393 393
             ->addCommand('-map', '[out]')
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
             $ffmpeg->addCommand('-i', $s, true);
418 418
             $merge .= '['.$k.':a]';
419 419
         }
420
-        $merge .= 'amerge=inputs='. count($sounds) .'[aout]';
420
+        $merge .= 'amerge=inputs='.count($sounds).'[aout]';
421 421
 
422 422
         $ffmpeg->addCommand('-filter_complex', $merge)
423 423
             ->addCommand('-map', '[aout]')
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     {
439 439
         $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
440 440
 
441
-        $text = "fontfile=$font:text='". $message."':fontsize=". $fontSize .":fontcolor=" . $fontColor . ":x=".$x.":y=".$y;
441
+        $text = "fontfile=$font:text='".$message."':fontsize=".$fontSize.":fontcolor=".$fontColor.":x=".$x.":y=".$y;
442 442
        
443 443
         $this->getServiceManager()->get('playgroundcore_phpvideotoolkit')
444 444
             ->addPreInputCommand('-y')
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
     {
483 483
         $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
484 484
         
485
-        $i=1;
485
+        $i = 1;
486 486
         foreach ($frames as $frame) {
487 487
             $this->getServiceManager()->get('playgroundcore_phpvideotoolkit')
488 488
                 ->addPreInputCommand('-y')
489 489
                 ->addCommand('-i', $source)
490 490
                 ->addCommand('-an')
491
-                ->addCommand('-vf', 'select=between(n\,' . $frame[0] . '\,' . $frame[1] . '),setpts=PTS-STARTPTS')
492
-                ->setOutputPath($target . sprintf('s%02d', $i) . '.mov')
491
+                ->addCommand('-vf', 'select=between(n\,'.$frame[0].'\,'.$frame[1].'),setpts=PTS-STARTPTS')
492
+                ->setOutputPath($target.sprintf('s%02d', $i).'.mov')
493 493
                 ->execute();
494 494
             $i++;
495 495
         }
Please login to merge, or discard this patch.
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
         $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
200 200
        
201 201
         $this->getServiceManager()->get('playgroundcore_phpvideotoolkit')
202
-           ->addCommand('-i', $videoSource)
203
-           ->addCommand('-i', $audioSource, true)
204
-           ->setOutputPath($target)
205
-           ->execute();
202
+            ->addCommand('-i', $videoSource)
203
+            ->addCommand('-i', $audioSource, true)
204
+            ->setOutputPath($target)
205
+            ->execute();
206 206
         return $target;
207 207
     }
208 208
 
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
     }
367 367
 
368 368
     /**
369
-    * This method concatenate an array of sounds
370
-    * ffmpeg -y -i in-1.wav -i in-2.wav -i in-3.wav
371
-    * -filter_complex '[0:0][1:0][2:0]concat=n=3:v=0:a=1[out]' -map '[out]' out.wav
372
-    */
369
+     * This method concatenate an array of sounds
370
+     * ffmpeg -y -i in-1.wav -i in-2.wav -i in-3.wav
371
+     * -filter_complex '[0:0][1:0][2:0]concat=n=3:v=0:a=1[out]' -map '[out]' out.wav
372
+     */
373 373
     public function concatenateSounds($sounds = array(), $target)
374 374
     {
375 375
         if (!is_array($sounds)) {
@@ -396,10 +396,10 @@  discard block
 block discarded – undo
396 396
     }
397 397
 
398 398
     /**
399
-    * This method merge an array of sounds
400
-    * ffmpeg -i in-1.wav -i in-2.wav -i in-3.wav
401
-    * -filter_complex "[0:a][1:a][2:a]amerge=inputs=3[aout]" -map "[aout]" -ac 2 out.wav
402
-    */
399
+     * This method merge an array of sounds
400
+     * ffmpeg -i in-1.wav -i in-2.wav -i in-3.wav
401
+     * -filter_complex "[0:a][1:a][2:a]amerge=inputs=3[aout]" -map "[aout]" -ac 2 out.wav
402
+     */
403 403
     public function mergeSounds($sounds = array(), $target)
404 404
     {
405 405
         if (!is_array($sounds)) {
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
     }
450 450
 
451 451
     /**
452
-    *  this method extracts an image form a video at the $time second in the video.
453
-    *  ffmpeg -ss 00:00:04 -i video.mp4 -vframes 1 out.png
454
-    */
452
+     *  this method extracts an image form a video at the $time second in the video.
453
+     *  ffmpeg -ss 00:00:04 -i video.mp4 -vframes 1 out.png
454
+     */
455 455
     public function extractImage($source, $target, $start = '00:00:01', $frames = 1)
456 456
     {
457 457
         $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
@@ -472,10 +472,10 @@  discard block
 block discarded – undo
472 472
     }
473 473
 
474 474
     /**
475
-    *  this method splits a video into n chunks defined by the frames array.
476
-    *  $frames = array(array(0, 12), array(13, 110), array(111, 200));
477
-    *  ffmpeg -i quickns.mov -an -vf "select=between(n\,110\,200),setpts=PTS-STARTPTS" grg.mov
478
-    */
475
+     *  this method splits a video into n chunks defined by the frames array.
476
+     *  $frames = array(array(0, 12), array(13, 110), array(111, 200));
477
+     *  ffmpeg -i quickns.mov -an -vf "select=between(n\,110\,200),setpts=PTS-STARTPTS" grg.mov
478
+     */
479 479
     public function splitVideo($source, $frames = array(), $target)
480 480
     {
481 481
         $this->getServiceManager()->setShared('playgroundcore_phpvideotoolkit', false);
Please login to merge, or discard this patch.
src/PlaygroundCore/Service/Image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function setImage($file)
27 27
     {
28 28
         if (!file_exists($file)) {
29
-            throw new \Exception('Not a file: "' . $file . '"', null, null);
29
+            throw new \Exception('Not a file: "'.$file.'"', null, null);
30 30
         }
31 31
         $this->file = $file;
32 32
         $this->image = imagecreatefromstring(
Please login to merge, or discard this patch.
src/PlaygroundCore/TwitterCard/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
     public function __construct($config)
35 35
     {
36 36
         if (isset($config['enable'])) {
37
-            $this->enable = (bool)$config['enable'];
37
+            $this->enable = (bool) $config['enable'];
38 38
         }
39 39
         if (isset($config['useDefault'])) {
40
-            $this->useDefault = (bool)$config['useDefault'];
40
+            $this->useDefault = (bool) $config['useDefault'];
41 41
         }
42 42
         if (isset($config['default'])) {
43 43
             foreach ($config['default'] as $key => $value) {
Please login to merge, or discard this patch.
src/PlaygroundCore/TwitterCard/Tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     public function __construct($property, $value = null)
10 10
     {
11 11
         $this->property = $property;
12
-        $this->value   = $value;
12
+        $this->value = $value;
13 13
     }
14 14
 
15 15
     public function getProperty()
Please login to merge, or discard this patch.