Create factory for plugins that resources can be registered with.
This commit is contained in:
parent
f88df400f0
commit
e1d8239e8a
5 changed files with 481 additions and 2 deletions
57
Tests/PHPCI/Plugin/Util/ExamplePlugins.php
Normal file
57
Tests/PHPCI/Plugin/Util/ExamplePlugins.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
namespace PHPCI\Plugin\Tests\Util;
|
||||
|
||||
use PHPCI\Builder;
|
||||
use PHPCI\Model\Build;
|
||||
use PHPCI\Plugin;
|
||||
|
||||
class ExamplePluginWithNoConstructorArgs {
|
||||
|
||||
}
|
||||
|
||||
class ExamplePluginWithSingleOptionalArg {
|
||||
function __construct($optional = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class ExamplePluginWithSingleRequiredArg {
|
||||
|
||||
public $RequiredArgument;
|
||||
|
||||
function __construct($requiredArgument)
|
||||
{
|
||||
$this->RequiredArgument = $requiredArgument;
|
||||
}
|
||||
}
|
||||
|
||||
class ExamplePluginWithSingleTypedRequiredArg {
|
||||
|
||||
public $RequiredArgument;
|
||||
|
||||
function __construct(\stdClass $requiredArgument)
|
||||
{
|
||||
$this->RequiredArgument = $requiredArgument;
|
||||
}
|
||||
}
|
||||
|
||||
class ExamplePluginFull implements Plugin {
|
||||
|
||||
public $Options;
|
||||
|
||||
public function __construct(
|
||||
Builder $phpci,
|
||||
Build $build,
|
||||
array $options = array()
|
||||
)
|
||||
{
|
||||
$this->Options = $options;
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue