Skip to content

Commit

Permalink
Merge pull request #46 from fcastilloes/add-has-variable
Browse files Browse the repository at this point in the history
Add Api::hasVariable()
  • Loading branch information
fcastilloes committed Jul 10, 2017
2 parents a5f8bb1 + bf024ad commit 2ee655b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
##Upcoming
## Fixed
- Fix meta byte for communicating calls
- Add `Api:hasVariable()`

## [1.1.5] - 2017-07-02
## Fixed
Expand Down
9 changes: 9 additions & 0 deletions src/Api/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ public function getVariables(): array
return $this->variables;
}

/**
* @param string $name
* @return bool
*/
public function hasVariable(string $name): bool
{
return isset($this->variables[$name]);
}

/**
* @param string $name
* @return string
Expand Down
6 changes: 6 additions & 0 deletions src/Api/ApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public function getFrameworkVersion(): string;
*/
public function getVariables(): array;

/**
* @param string $name
* @return string
*/
public function hasVariable(string $name): bool;

/**
* @param $name
* @return string
Expand Down

0 comments on commit 2ee655b

Please sign in to comment.