Skip to content

Commit

Permalink
Merge pull request #6 from jaapio/feature/FileInterface
Browse files Browse the repository at this point in the history
Project factory accepts File implementations only
  • Loading branch information
mvriel committed Dec 27, 2015
2 parents 8dfc66d + f304ed5 commit 144c307
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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 for files processed by the ProjectFactory
*/
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 144c307

Please sign in to comment.