From bec7102dce5d95077b890b18adbf648d7ad4785e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1gi-Kaz=C3=A1r=20M=C3=A1rk?= Date: Tue, 13 Jan 2015 23:52:16 +0100 Subject: [PATCH] Moving to SupervisorPHP --- composer.json | 2 +- spec/Configuration/Parser/FilesystemSpec.php | 7 +++++++ src/Configuration/Parser/Filesystem.php | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 22703c0..d02464f 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/spec/Configuration/Parser/FilesystemSpec.php b/spec/Configuration/Parser/FilesystemSpec.php index 7e844b1..399f770 100644 --- a/spec/Configuration/Parser/FilesystemSpec.php +++ b/spec/Configuration/Parser/FilesystemSpec.php @@ -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(); + } } diff --git a/src/Configuration/Parser/Filesystem.php b/src/Configuration/Parser/Filesystem.php index 5d42b26..2bcbd6e 100644 --- a/src/Configuration/Parser/Filesystem.php +++ b/src/Configuration/Parser/Filesystem.php @@ -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);