Skip to content

Commit

Permalink
Project factory accepts File implementations only
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapio committed Dec 27, 2015
1 parent 8dfc66d commit 4b42a14
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* This file is part of phpDocumentor.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright 2010-2015 Mike van Riel<[email protected]>
* @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();
}
2 changes: 1 addition & 1 deletion src/ProjectFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4b42a14

Please sign in to comment.