Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support fluent interface e.g., $this->foo()->bar()->etc()

  • Loading branch information...
commit 143a13c70c8bbcdffc74deec9ae72970e87db4d2 1 parent 5f10ff4
Mariano Peterson authored
Showing with 11 additions and 16 deletions.
  1. +9 −9 CliParser.php
  2. +2 −7 Slog.php
View
18 CliParser.php
@@ -18,14 +18,14 @@ class CliParser
const TYPE_FLAG = 2;
/**
- * @var int Indicates an input option can be provided as a
+ * @var int Indicates an input option can be provided as a
* key/value pair multiple times.
- * (i.e., "--var=foo --var=bar" or "--var=foo,bar")
+ * (i.e., "--var=foo --var=bar" or "--var=foo,bar")
*/
const TYPE_ARRAY = 3;
-
+
/**
- * @var string the delimiter to use with self::TYPE_ARRAY
+ * @var string the delimiter to use with self::TYPE_ARRAY
*/
const DEFAULT_DELIMITER = ',';
@@ -90,11 +90,11 @@ public function about($msg)
* @return Opt (supports fluent interface)
*/
public function addOpt(
- $short,
- $long,
- $help,
- $required = false,
- $type = self::TYPE_VALUE,
+ $short,
+ $long,
+ $help,
+ $required = false,
+ $type = self::TYPE_VALUE,
$delimiter = self::DEFAULT_DELIMITER
)
{
View
9 Slog.php
@@ -166,7 +166,7 @@ public function fetchXml($cmd)
*
* @param string|array<string> $author Author(s) whose commits will be removed.
*
- * @return void
+ * @return Slog (supports fluent interface)
*/
public function removeCommitsFromAuthor($author)
{
@@ -174,12 +174,10 @@ public function removeCommitsFromAuthor($author)
$author = explode(',', $author);
}
$author = array_filter($author);
- if (empty($author)) {
- return;
- }
foreach ($author as $a) {
$this->removeAuthors[$a] = 1;
}
+ return $this;
}
/**
@@ -195,9 +193,6 @@ public function matchAuthor($author)
$author = explode(',', $author);
}
$author = array_filter($author);
- if (empty($author)) {
- return;
- }
foreach ($author as $a) {
$this->mustMatchAuthors[$a] = 1;
}
Please sign in to comment.
Something went wrong with that request. Please try again.