From 4b42a14c46ccd9bb0a07521123eb12a1bce1c0e3 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Sun, 27 Dec 2015 12:11:24 +0100 Subject: [PATCH] Project factory accepts File implementations only --- src/File.php | 38 ++++++++++++++++++++++++++++++++++++++ src/ProjectFactory.php | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/File.php diff --git a/src/File.php b/src/File.php new file mode 100644 index 0000000..7cf7cf2 --- /dev/null +++ b/src/File.php @@ -0,0 +1,38 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + + +interface File +{ + /** + * Returns the content of the file as a string. + * + * @return string + */ + public function getContents(); + + /** + * Returns md5 hash of the file. + * + * @return string + */ + public function md5(); + + /** + * Returns an relative path to the file. + * + * @return string + */ + public function path(); +} diff --git a/src/ProjectFactory.php b/src/ProjectFactory.php index f2c091d..5602f84 100644 --- a/src/ProjectFactory.php +++ b/src/ProjectFactory.php @@ -20,7 +20,7 @@ interface ProjectFactory * Creates a project from the set of files. * * @param string $name - * @param string[] $files + * @param File[] $files * @return Project */ public function create($name, array $files);