@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - public static function getOpts($args=array(), $cliOpts=array()) |
|
| 67 | + public static function getOpts($args = array(), $cliOpts = array()) |
|
| 68 | 68 | { |
| 69 | - if (count($args) > 0) |
|
| 69 | + if (count($args)>0) |
|
| 70 | 70 | // throw new \Exception('Missing library version argument'); |
| 71 | 71 | self::$libVersion = $args[0]; |
| 72 | 72 | |
@@ -174,17 +174,17 @@ discard block |
||
| 174 | 174 | $out = ''; |
| 175 | 175 | while (($start = strpos($content, $startTag, $last)) !== false) { |
| 176 | 176 | $end = strpos($content, $endTag, $start); |
| 177 | - $code = substr($content, $start + strlen($startTag), $end - $start - strlen($startTag)); |
|
| 178 | - if ($code[strlen($code) - 1] == "\n") { |
|
| 177 | + $code = substr($content, $start+strlen($startTag), $end-$start-strlen($startTag)); |
|
| 178 | + if ($code[strlen($code)-1] == "\n") { |
|
| 179 | 179 | $code = substr($code, 0, -1); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | $code = str_replace(array('>', '<'), array('>', '<'), $code); |
| 183 | - $code = highlight_string('<?php ' . $code, true); |
|
| 183 | + $code = highlight_string('<?php '.$code, true); |
|
| 184 | 184 | $code = str_replace('<span style="color: #0000BB"><?php <br />', '<span style="color: #0000BB">', $code); |
| 185 | 185 | |
| 186 | - $out = $out . substr($content, $last, $start + strlen($startTag) - $last) . $code . $endTag; |
|
| 187 | - $last = $end + strlen($endTag); |
|
| 186 | + $out = $out.substr($content, $last, $start+strlen($startTag)-$last).$code.$endTag; |
|
| 187 | + $last = $end+strlen($endTag); |
|
| 188 | 188 | } |
| 189 | 189 | $out .= substr($content, $last, strlen($content)); |
| 190 | 190 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | use PhpXmlRpc\Builder; |
| 200 | 200 | |
| 201 | -function run_default($task=null, $args=array(), $cliOpts=array()) |
|
| 201 | +function run_default($task = null, $args = array(), $cliOpts = array()) |
|
| 202 | 202 | { |
| 203 | 203 | echo "Syntax: pake {\$pake-options} \$task \$lib-version [\$git-tag] {\$task-options}\n"; |
| 204 | 204 | echo "\n"; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | echo " --zip=ZIP Location of the zip tool\n"; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | -function run_getopts($task=null, $args=array(), $cliOpts=array()) |
|
| 219 | +function run_getopts($task = null, $args = array(), $cliOpts = array()) |
|
| 220 | 220 | { |
| 221 | 221 | Builder::getOpts($args, $cliOpts); |
| 222 | 222 | } |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * Downloads source code in the build workspace directory, optionally checking out the given branch/tag |
| 226 | 226 | * @todo allow using current installation / dir as source, bypassing git clone in workspace - at least for doc generation |
| 227 | 227 | */ |
| 228 | -function run_init($task=null, $args=array(), $cliOpts=array()) |
|
| 228 | +function run_init($task = null, $args = array(), $cliOpts = array()) |
|
| 229 | 229 | { |
| 230 | 230 | // download the current version into the workspace |
| 231 | 231 | $targetDir = Builder::workspaceDir(); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * |
| 255 | 255 | * (does nothing by itself, as all the steps are managed via task dependencies) |
| 256 | 256 | */ |
| 257 | -function run_build($task=null, $args=array(), $cliOpts=array()) |
|
| 257 | +function run_build($task = null, $args = array(), $cliOpts = array()) |
|
| 258 | 258 | { |
| 259 | 259 | } |
| 260 | 260 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | /** |
| 271 | 271 | * Generates documentation in all formats |
| 272 | 272 | */ |
| 273 | -function run_doc($task=null, $args=array(), $cliOpts=array()) |
|
| 273 | +function run_doc($task = null, $args = array(), $cliOpts = array()) |
|
| 274 | 274 | { |
| 275 | 275 | // in |
| 276 | 276 | $srcDir = Builder::workspaceDir(); |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | // from phpdoc comments using phpdocumentor |
| 283 | 283 | $cmd = Builder::tool('php'); |
| 284 | - pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/phpdoc run --cache-folder ".Builder::buildDir()."/.phpdoc -d ".$srcDir.'/src'." -t ".$docDir.'/api --title PHP-XMLRPC --defaultpackagename PHPXMLRPC'); |
|
| 284 | + pake_sh("$cmd ".Builder::toolsDir()."/vendor/bin/phpdoc run --cache-folder ".Builder::buildDir()."/.phpdoc -d ".$srcDir.'/src'." -t ".$docDir.'/api --title PHP-XMLRPC --defaultpackagename PHPXMLRPC'); |
|
| 285 | 285 | |
| 286 | 286 | // from phpdoc comments using Sami - deprecated on 2021/12, as Sami is abandonware |
| 287 | 287 | /*$samiConfig = <<<EOT |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | /** |
| 362 | 362 | * Creates the tarballs for a release |
| 363 | 363 | */ |
| 364 | -function run_dist($task=null, $args=array(), $cliOpts=array()) |
|
| 364 | +function run_dist($task = null, $args = array(), $cliOpts = array()) |
|
| 365 | 365 | { |
| 366 | 366 | // copy workspace dir into dist dir, without git |
| 367 | 367 | pake_mkdirs(Builder::distDir()); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | // create tarballs |
| 377 | 377 | $cwd = getcwd(); |
| 378 | 378 | chdir(dirname(Builder::distDir())); |
| 379 | - foreach(Builder::distFiles() as $distFile) { |
|
| 379 | + foreach (Builder::distFiles() as $distFile) { |
|
| 380 | 380 | // php can not really create good zip files via phar: they are not compressed! |
| 381 | 381 | if (substr($distFile, -4) == '.zip') { |
| 382 | 382 | $cmd = Builder::tool('zip'); |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | chdir($cwd); |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | -function run_clean_workspace($task=null, $args=array(), $cliOpts=array()) |
|
| 397 | +function run_clean_workspace($task = null, $args = array(), $cliOpts = array()) |
|
| 398 | 398 | { |
| 399 | 399 | if (realpath(__DIR__) === realpath(Builder::workspaceDir())) { |
| 400 | 400 | throw new \Exception("Can not remove workspace dir, as it is where pakefile is located!"); |
@@ -406,13 +406,13 @@ discard block |
||
| 406 | 406 | * Cleans up the whole build directory |
| 407 | 407 | * @todo 'make clean' usually just removes the results of the build, distclean removes all but sources |
| 408 | 408 | */ |
| 409 | -function run_clean($task=null, $args=array(), $cliOpts=array()) |
|
| 409 | +function run_clean($task = null, $args = array(), $cliOpts = array()) |
|
| 410 | 410 | { |
| 411 | 411 | pake_remove_dir(Builder::buildDir()); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | // helper task: display help text |
| 415 | -pake_task( 'default' ); |
|
| 415 | +pake_task('default'); |
|
| 416 | 416 | // internal task: parse cli options |
| 417 | 417 | pake_task('getopts'); |
| 418 | 418 | pake_task('init', 'getopts'); |