-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdda59c
commit cb980bc
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Tapestry\Modules\Generators; | ||
|
||
use Tapestry\Entities\Project; | ||
use Tapestry\Modules\Source\SourceInterface; | ||
|
||
/** | ||
* Interface GeneratorInterface | ||
* | ||
* Each Generator should implement this basic interface and | ||
* regardless of whether they generate one file or many | ||
* the generate method should always return an array. | ||
*/ | ||
interface GeneratorInterface | ||
{ | ||
/** | ||
* Set the source that this generator works from. | ||
* | ||
* @param SourceInterface $source | ||
* @return void | ||
*/ | ||
public function setSource(SourceInterface $source); | ||
|
||
/** | ||
* Run the generation and return an array of generated | ||
* files (oddly implementing SourceInterface, naming | ||
* things is hard!) | ||
* | ||
* @param Project $project | ||
* @return array|SourceInterface[] | ||
*/ | ||
public function generate(Project $project): array; | ||
} |