Skip to content

Commit

Permalink
Moving to SupervisorPHP
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Jan 13, 2015
1 parent 0ce446d commit bec7102
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Manage Supervisor configuration in PHP",
"license": "MIT",
"keywords": ["supervisor", "configuration"],
"homepage": "https://indigophp.com",
"homepage": "https://supervisorphp.com",
"authors": [
{
"name": "Márk Sági-Kazár",
Expand Down
7 changes: 7 additions & 0 deletions spec/Configuration/Parser/FilesystemSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ function it_throws_an_exception_when_invalid_file_given(Flysystem $filesystem)

$this->shouldThrow('Supervisor\Exception\ParsingFailed')->duringParse();
}

function it_throws_an_exception_when_cannot_read_file_given(Flysystem $filesystem)
{
$filesystem->read('supervisord.conf')->willReturn(false);

$this->shouldThrow('Supervisor\Exception\ParsingFailed')->duringParse();
}
}
4 changes: 3 additions & 1 deletion src/Configuration/Parser/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public function parse(Configuration $configuration = null)
throw new ParsingFailed(sprintf('File "%s" not found', $this->file));
}

$fileContents = $this->filesystem->read($this->file);
if (!$fileContents = $this->filesystem->read($this->file)) {
throw new ParsingFailed(sprintf('Reading file "%s" failed', $this->file));
}

$parser = new Text($fileContents);

Expand Down

0 comments on commit bec7102

Please sign in to comment.