OSDN Git Service
(root)
/
wvm
/
wvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8ea7f5
)
Revert "remove redundant array_filter() around preg_split()"
author
scribu
<mail@scribu.net>
Tue, 30 Jul 2013 02:05:19 +0000
(
05:05
+0300)
committer
scribu
<mail@scribu.net>
Tue, 30 Jul 2013 02:10:11 +0000
(
05:10
+0300)
This reverts commit
e8ea7f5b62baeb860cdc329a029d2cbc854f2d5c
.
It's not redundant when the synopsis has leading or trailing whitespace
or when it's an empty string.
php/WP_CLI/SynopsisParser.php
patch
|
blob
|
history
diff --git
a/php/WP_CLI/SynopsisParser.php
b/php/WP_CLI/SynopsisParser.php
index
c28173e
..
d7e4c1b
100644
(file)
--- a/
php/WP_CLI/SynopsisParser.php
+++ b/
php/WP_CLI/SynopsisParser.php
@@
-9,7
+9,7
@@
class SynopsisParser {
* @return array List of parameters
*/
static function parse( $synopsis ) {
- $tokens =
preg_split( '/[\s\t]+/', $synopsis
);
+ $tokens =
array_filter( preg_split( '/[\s\t]+/', $synopsis )
);
$params = array();
foreach ( $tokens as $token ) {