Skip to content

Commit

Permalink
Merge pull request #10 from enygma/get-single-content
Browse files Browse the repository at this point in the history
allow for the pull of a single value using getContent on the Parser class
  • Loading branch information
m1 authored Jun 19, 2018
2 parents 3589eae + f36470a commit 294adde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ private function parseKeyValue($raw_line)
*
* @return array The .env contents
*/
public function getContent()
public function getContent($keyName = null)
{
if (!is_null($keyName)) {
return (array_key_exists($keyName, $this->lines)) ? $this->lines[$keyName] : null;
}
return $this->lines;
}
}

0 comments on commit 294adde

Please sign in to comment.