-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Dakujem; | ||
|
||
/** | ||
* A general interface for an object able to create instances of other classes. | ||
* These implementations will usually provide arguments to the constructor call. | ||
* | ||
* @author Andrej Rypák (dakujem) <[email protected]> | ||
*/ | ||
interface Constructor | ||
{ | ||
/** | ||
* Creates an instance of a class. | ||
* | ||
* @param string $target class name of a class to be instantiated | ||
* @return mixed an instance of the target class | ||
*/ | ||
public function construct(string $target); | ||
} |
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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Dakujem; | ||
|
||
/** | ||
* A general interface for an object able to invoke callables. | ||
* These implementations will usually provide arguments to the call. | ||
* | ||
* @author Andrej Rypák (dakujem) <[email protected]> | ||
*/ | ||
interface Invoker | ||
{ | ||
/** | ||
* Invokes a callable. | ||
* Returns the result of the call. | ||
* Arguments provided to the call differ according to implementation. | ||
* | ||
* @param callable $target callable to be invoked | ||
* @return mixed result of the $target callable invocation | ||
*/ | ||
public function invoke(callable $target); | ||
} |