-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#75] InputMerger not merging options with defaults properly
Add an InspectableArgvInput input class so that we may check if arguments/options are set.
- Loading branch information
Showing
4 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace PHPSemVerChecker\Console; | ||
|
||
use Symfony\Component\Console\Input\ArgvInput; | ||
|
||
class InspectableArgvInput extends ArgvInput | ||
{ | ||
/** | ||
* Returns true if the argument value is set. | ||
* | ||
* @param string $name The argument name | ||
* | ||
* @return bool true if the argument is set (not a default value) | ||
*/ | ||
public function hasArgumentSet($name) | ||
{ | ||
return isset($this->arguments[$name]); | ||
} | ||
|
||
/** | ||
* Returns true if the option value is set. | ||
* | ||
* @param string $name The option name | ||
* | ||
* @return bool true if the option is set (not a default value) | ||
*/ | ||
public function hasOptionSet($name) | ||
{ | ||
return isset($this->options[$name]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters