Passed
Push — master ( 970c56...251b1a )
by Gaetano
09:46
created
pakefile.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
         );
64 64
     }
65 65
 
66
-    public static function getOpts($args=array(), $cliOpts=array())
66
+    public static function getOpts($args = array(), $cliOpts = array())
67 67
     {
68
-        if (count($args) > 0)
68
+        if (count($args)>0)
69 69
         //    throw new \Exception('Missing library version argument');
70 70
             self::$libVersion = $args[0];
71 71
 
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
         $out = '';
169 169
         while (($start = strpos($content, $startTag, $last)) !== false) {
170 170
             $end = strpos($content, $endTag, $start);
171
-            $code = substr($content, $start + strlen($startTag), $end - $start - strlen($startTag));
172
-            if ($code[strlen($code) - 1] == "\n") {
171
+            $code = substr($content, $start+strlen($startTag), $end-$start-strlen($startTag));
172
+            if ($code[strlen($code)-1] == "\n") {
173 173
                 $code = substr($code, 0, -1);
174 174
             }
175 175
 
176 176
             $code = str_replace(array('&gt;', '&lt;'), array('>', '<'), $code);
177
-            $code = highlight_string('<?php ' . $code, true);
177
+            $code = highlight_string('<?php '.$code, true);
178 178
             $code = str_replace('<span style="color: #0000BB">&lt;?php&nbsp;<br />', '<span style="color: #0000BB">', $code);
179 179
 
180
-            $out = $out . substr($content, $last, $start + strlen($startTag) - $last) . $code . $endTag;
181
-            $last = $end + strlen($endTag);
180
+            $out = $out.substr($content, $last, $start+strlen($startTag)-$last).$code.$endTag;
181
+            $last = $end+strlen($endTag);
182 182
         }
183 183
         $out .= substr($content, $last, strlen($content));
184 184
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 use PhpXmlRpc\Builder;
194 194
 
195
-function run_default($task=null, $args=array(), $cliOpts=array())
195
+function run_default($task = null, $args = array(), $cliOpts = array())
196 196
 {
197 197
     echo "Syntax: pake {\$pake-options} \$task \$lib-version [\$git-tag] {\$task-options}\n";
198 198
     echo "\n";
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     echo "      --zip=ZIP        Location of the zip tool\n";
211 211
 }
212 212
 
213
-function run_getopts($task=null, $args=array(), $cliOpts=array())
213
+function run_getopts($task = null, $args = array(), $cliOpts = array())
214 214
 {
215 215
     Builder::getOpts($args, $cliOpts);
216 216
 }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
  * Downloads source code in the build workspace directory, optionally checking out the given branch/tag
220 220
  * @todo allow using current installation / dir as source, bypassing git clone in workspace - at least for doc generation
221 221
  */
222
-function run_init($task=null, $args=array(), $cliOpts=array())
222
+function run_init($task = null, $args = array(), $cliOpts = array())
223 223
 {
224 224
     // download the current version into the workspace
225 225
     $targetDir = Builder::workspaceDir();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * (does nothing by itself, as all the steps are managed via task dependencies)
249 249
  */
250
-function run_build($task=null, $args=array(), $cliOpts=array())
250
+function run_build($task = null, $args = array(), $cliOpts = array())
251 251
 {
252 252
 }
253 253
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 /**
264 264
  * Generates documentation in all formats
265 265
  */
266
-function run_doc($task=null, $args=array(), $cliOpts=array())
266
+function run_doc($task = null, $args = array(), $cliOpts = array())
267 267
 {
268 268
     // in
269 269
     $srcDir = Builder::workspaceDir();
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
     // from phpdoc comments using phpdocumentor
276 276
     $cmd = Builder::tool('php');
277
-    pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/phpdoc run --cache-folder ".Builder::buildDir()."/.phpdoc -d ".$srcDir.'/src'." -t ".$docDir.'/api --title PHP-XMLRPC');
277
+    pake_sh("$cmd ".Builder::toolsDir()."/vendor/bin/phpdoc run --cache-folder ".Builder::buildDir()."/.phpdoc -d ".$srcDir.'/src'." -t ".$docDir.'/api --title PHP-XMLRPC');
278 278
 
279 279
     // from phpdoc comments using Sami
280 280
     // deprecated on 2021/12, as Sami is abandonware
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 /**
356 356
  * Creates the tarballs for a release
357 357
  */
358
-function run_dist($task=null, $args=array(), $cliOpts=array())
358
+function run_dist($task = null, $args = array(), $cliOpts = array())
359 359
 {
360 360
     // copy workspace dir into dist dir, without git
361 361
     pake_mkdirs(Builder::distDir());
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     // create tarballs
371 371
     $cwd = getcwd();
372 372
     chdir(dirname(Builder::distDir()));
373
-    foreach(Builder::distFiles() as $distFile) {
373
+    foreach (Builder::distFiles() as $distFile) {
374 374
         // php can not really create good zip files via phar: they are not compressed!
375 375
         if (substr($distFile, -4) == '.zip') {
376 376
             $cmd = Builder::tool('zip');
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     chdir($cwd);
389 389
 }
390 390
 
391
-function run_clean_workspace($task=null, $args=array(), $cliOpts=array())
391
+function run_clean_workspace($task = null, $args = array(), $cliOpts = array())
392 392
 {
393 393
     if (realpath(__DIR__) === realpath(Builder::workspaceDir())) {
394 394
         throw new \Exception("Can not remove workspace dir, as it is where pakefile is located!");
@@ -400,13 +400,13 @@  discard block
 block discarded – undo
400 400
  * Cleans up the whole build directory
401 401
  * @todo 'make clean' usually just removes the results of the build, distclean removes all but sources
402 402
  */
403
-function run_clean($task=null, $args=array(), $cliOpts=array())
403
+function run_clean($task = null, $args = array(), $cliOpts = array())
404 404
 {
405 405
     pake_remove_dir(Builder::buildDir());
406 406
 }
407 407
 
408 408
 // helper task: display help text
409
-pake_task( 'default' );
409
+pake_task('default');
410 410
 // internal task: parse cli options
411 411
 pake_task('getopts');
412 412
 pake_task('init', 'getopts');
Please login to merge, or discard this patch.