From ad26d05b8418480322bb6dded0cbbb9ff4581983 Mon Sep 17 00:00:00 2001 From: angryThom Date: Tue, 31 Mar 2015 09:31:53 +0200 Subject: [PATCH] Minor fixes. Added missing interface. Replaced with DIRECTORY_SEPARATOR --- src/Naneau/ProjectVersioner/Reader/Composer.php | 4 +++- src/Naneau/ProjectVersioner/Reader/ComposerPackage.php | 4 +++- src/Naneau/ProjectVersioner/Reader/File.php | 4 ++-- src/Naneau/ProjectVersioner/Versioner.php | 6 +++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Naneau/ProjectVersioner/Reader/Composer.php b/src/Naneau/ProjectVersioner/Reader/Composer.php index 7703b4b..4a1ef5d 100644 --- a/src/Naneau/ProjectVersioner/Reader/Composer.php +++ b/src/Naneau/ProjectVersioner/Reader/Composer.php @@ -8,6 +8,8 @@ namespace Naneau\ProjectVersioner\Reader; +use Naneau\ProjectVersioner\ReaderInterface; + /** * Composer * @@ -17,7 +19,7 @@ * @package ProjectVersioner * @subpackage Reader */ -class Composer +class Composer implements ReaderInterface { /** * {@inheritdoc} diff --git a/src/Naneau/ProjectVersioner/Reader/ComposerPackage.php b/src/Naneau/ProjectVersioner/Reader/ComposerPackage.php index 45feb0b..64890b4 100644 --- a/src/Naneau/ProjectVersioner/Reader/ComposerPackage.php +++ b/src/Naneau/ProjectVersioner/Reader/ComposerPackage.php @@ -8,6 +8,8 @@ namespace Naneau\ProjectVersioner\Reader; +use Naneau\ProjectVersioner\ReaderInterface; + /** * ComposerPackage * @@ -17,7 +19,7 @@ * @package ProjectVersioner * @subpackage Reader */ -class ComposerPackage +class ComposerPackage implements ReaderInterface { /** * The page name to look for diff --git a/src/Naneau/ProjectVersioner/Reader/File.php b/src/Naneau/ProjectVersioner/Reader/File.php index cc5c906..9ed31a5 100644 --- a/src/Naneau/ProjectVersioner/Reader/File.php +++ b/src/Naneau/ProjectVersioner/Reader/File.php @@ -44,7 +44,7 @@ public function __construct($file) **/ public function canRead($directory) { - return is_readable($directory . '/' . $this->getFile()); + return is_readable($directory . DIRECTORY_SEPARATOR . $this->getFile()); } /** @@ -52,7 +52,7 @@ public function canRead($directory) **/ public function read($directory) { - return trim(file_get_contents($directory . '/' . $this->getFile())); + return trim(file_get_contents($directory . DIRECTORY_SEPARATOR . $this->getFile())); } /** diff --git a/src/Naneau/ProjectVersioner/Versioner.php b/src/Naneau/ProjectVersioner/Versioner.php index b7084ff..0df4cd5 100644 --- a/src/Naneau/ProjectVersioner/Versioner.php +++ b/src/Naneau/ProjectVersioner/Versioner.php @@ -118,12 +118,12 @@ public function setReaders(array $readers) /** * Add a reader * - * @param Reader[] $readers + * @param Reader[] $reader * @return Versioner */ - public function addReaders() + public function addReader(Reader $reader) { - $this->readers[] = $readers; + $this->readers[] = $reader; return $this; }